meteor-feature-requests icon indicating copy to clipboard operation
meteor-feature-requests copied to clipboard

More detailed profiling of `buildLocalPackages`

Open sebakerckhof opened this issue 7 years ago • 3 comments

My rebuild times are very inconsistent and the biggest culprit seems to be other _buildLocalPackages inside the prepareProjectForBuild step. It would be great to have a more detailed profiling, since now 90% of my rebuild time is spend in there.

| Top leaves:
| other _buildLocalPackages...............................82,657 ms (1)
| other IsopackCache Build local isopack...................3,089 ms (41)
| files.rm_recursive.......................................2,630 ms (6)
| files.readFile...........................................2,078 ms (7193)
| other optimistic lstatOrNull.............................1,070 ms (7125)
| files.writeFile............................................783 ms (8865)
| other Builder#copyDirectory................................694 ms (2)
| files.stat.................................................537 ms (18933)
| other optimistic readFile..................................518 ms (7034)
| other files.withCache......................................503 ms (12)
| other Isopack#saveToPath...................................375 ms (2)
| other optimistic lstat.....................................341 ms (7044)
| other optimistic statOrNull................................319 ms (6920)
| other compileUnibuild (barco:edu)..........................259 ms (3)
| other Builder#write........................................223 ms (2090)
| files.readdir..............................................215 ms (3043)
| files.lstat................................................165 ms (7047)
| other watch.isUpToDate.....................................157 ms (43)
| sha1.......................................................119 ms (2116)

sebakerckhof avatar Mar 27 '18 12:03 sebakerckhof

This should be pretty straightforward, I think.

benjamn avatar Apr 06 '18 14:04 benjamn

If you run meteor update --release 1.6.2-beta.20, you should get a lot more insight into what's happening during _buildLocalPackages.

benjamn avatar Apr 06 '18 16:04 benjamn

Thanks @benjamn . Unfortunately, all the time keeps being recorded under other _buildLocalPackages., and after profiling the meteor tool with chrome's developer tools ( https://github.com/meteor/meteor/issues/9568#issuecomment-377290518 ) it looks like all that time is spend by the garbage collector in the _buildLocalPackages step and reported as the other _buildLocalPackages. leave. If I increase --max-old-space-size from 4096 to 8192 it makes a big difference.

sebakerckhof avatar Apr 09 '18 13:04 sebakerckhof