Passing a function to files.withCache invokes the function and causes the
results of these four files.* methods to be cached for the duration of the
function invocation.
Part of #7253 and #7008.
This saves 25+ *seconds* when building the modules test app, and will
likely have huge benefits for any other sizeable app, too.
Since the temporary directory is created with files.mkdtemp, and those
directories are cleaned up at shutdown, this reimplementation effectively
defers the work of rm_recursive until shutdown, which is much better than
doing it during startup.
This reverts commit 7227f64ea8.
This reverts commit b4972af3a5.
Saving 400ms of rebuild time isn't worth sometimes having to restart the
app from scratch.
If you have a lot of packages and you change something in a package that
is used by lots of other packages, such as "meteor" or "modules", then the
rebuild can take a lot longer than ten seconds.
we were already passing the mode of `from` into `files.copyFile`
in at least one place, but `files.copyFile` was dropping it on
the floor. now we use it avoid doing a second stat.
Also, list copyFile in the profiler report. copyFile does its own
custom file I/O, so it didn't show up as a readFile or writeFile
which are automatically profiled.
Previously, we would generate reports on
"Selecting Package Versions" and "Rebuild App".
- Instead of just profiling constraint solving, profile the entire
process of preparing the project via ProjectContext, by giving
each public function that "advances the stage" a Profile.run
(typically prepareProjectForBuild).
- Improve profiler output to better distinguish multiple runs
- Distinguish "Build App" and "Rebuild App"
- Instrument lots of calls that weren't instrumented before