Skip to content

Speed up TypeScript compilation when running test suite #416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 26, 2015

Conversation

robertknight
Copy link

Speed up the test suite by updating to the current version
of the TypeScript compiler which is ~5x faster than the 1.0
version that was being used previously and caching compiled
TypeScript files.

  • Update type definitions and flatten.ts for compatibility
    with TS 1.4
  • Remove ts-compiler dependency and use the now-public TypeScript
    compiler API directly.

Fixes #399

With these changes a full run of the test suite on my laptop goes from ~100s to ~20s on first run and ~10s for subsequent runs where the test files have not changed.

There is currently a test failure in slice.ts which I'm looking into

Speed up the test suite by updating to the current version
of the TypeScript compiler which is ~5x faster than the 1.0
version that was being used previously and caching compiled
TypeScript files.

 * Update type definitions and flatten.ts for compatibility
   with TS 1.4
 * Remove ts-compiler dependency and use the now-public TypeScript
   compiler API directly.

Fixes immutable-js#399
@leebyron
Copy link
Collaborator

There are some failing tests because of this change. What's the reason for that?

Robert Knight added 3 commits March 26, 2015 19:25
The test comment indicated that one trailing hole was
expected but the argument to toEqual() had two.

This used to pass previously due to an emission bug in the TypeScript 1.0
compiler which is fixed in TS 1.4
@@ -31,7 +31,7 @@ describe('slice', () => {
it('slices a sparse indexed sequence', () => {
expect(Seq([1,,2,,3,,4,,5,,6]).slice(1).toArray()).toEqual([,2,,3,,4,,5,,6]);
expect(Seq([1,,2,,3,,4,,5,,6]).slice(2).toArray()).toEqual([2,,3,,4,,5,,6]);
expect(Seq([1,,2,,3,,4,,5,,6]).slice(3, -3).toArray()).toEqual([,3,,4,,,]); // one trailing hole.
expect(Seq([1,,2,,3,,4,,5,,6]).slice(3, -3).toArray()).toEqual([,3,,4,,]); // one trailing hole.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess TypeScript changed their rules around trailing comma removal in 1.4?

leebyron added a commit that referenced this pull request Mar 26, 2015
Speed up TypeScript compilation when running test suite
@leebyron leebyron merged commit b72045e into immutable-js:master Mar 26, 2015
@leebyron
Copy link
Collaborator

Nice work!

@robertknight
Copy link
Author

I guess TypeScript changed their rules around trailing comma removal in 1.4?

Looks to me like it was simply a bug that got fixed.

Thanks for the quick review!

@andrewluetgers
Copy link

I'm having trouble getting started with contribution to the project. My first time trying to run tests failed. I tried with the tag prior to this change and all was fine. I just filed an issue for it #431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests are slow
3 participants