-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Compilation quickly slows down with increasing codebase size #4287
Comments
Almost all the extra time is spent in the checker:
When you remove tests:
Perhaps tellingly there are almost half as many types when compiling without tests. Despite only cutting ~25% LOC, you cut ~50% of the types! |
@sheetalkamat can you take a look.. |
@IgorMinar : I ran this with node and the result was this: Vs without test folder But as @mhegazy suggested me, I ran this with iojs and the result was this indicating this to be node issue. Vs Files: 447 |
Thanks! I'll try to play with different node versions |
This is a followup issue to #4282.
As our Angular2 codebase grows we noticed that the compilation time seems to be increasing non-linearly/exponentially with the code size growth.
In Angular repo we have several modules that we are compiling together and I noticed that simply removing some modules can significantly improve the performance. What's interesting is that it doesn't matter which modules I drop. Any of them can result in improvements more significant the size the removed modules contribute to the overall compilation unit.
To repro with tsc on the angular code base:
cd angular
npm install
time ./node_modules/.bin/tsc -p modules
rm -rf modules/<some_module>
time ./node_modules/.bin/tsc -p modules
You might delete any modules except for the main
angular2
module which other modules depend on. All these modules are leaves except forangular2_material
which is being depended on byexamples
module.Example numbers in ES6 mode (patched tsc v1.5.3 - see #4282 for more info about the patches) :
benchpress
: ~19s (total LoC=66902)examples
:~16s (total LoC=63989)rtts_assert
: ~16s (total LoC=63251)benchmarks
: ~14s (total LoC=60294)benchmarks_external
: ~14s (total LoC=59675)angular2_material
: ~11s (total LoC=58221)angular2/test
: ~5s (total LoC=31942)Now interestingly if I remove
angular2/test
first, slimming the code base significantly I get different numbers:angular2/test
: ~7s (total LoC=45029)benchpress
: ~6.5s (total LoC=40623)examples
:~6s (total LoC=37710)rtts_assert
: ~6s (total LoC=36972)benchmarks
: ~5.8s (total LoC=34015)benchmarks_external
: ~5.5s (total LoC=33396)angular2_material
: ~5s (total LoC=31942)This shows that removing the
angular2/test
folder which contributes significantly to the overall codebase size can speed up the compilation by either 14s or 6s depending on what other modules are we compiling (even though theangular2/test
has no dependencies on these other modules (with the exception of the coreangular2
module that all of the modules depend on.My assumption is that since the
angular2/test
is a leaf, removing it first or last should yield in the same absolute perf improvement, but that's not the case. I'm using this to simulate code-base growth since what we see is that the compilation time is increasing faster than our code base.The text was updated successfully, but these errors were encountered: