To avoid solving the full constraint-solver problem when you start your
app with a previousSolution (i.e. .meteor/versions), we first try to
prove that .meteor/versions is correct as far as we can tell while only
loading the package versions mentioned there.
When it works, it saves both disk I/O and logic-solving time, starting
at a couple seconds and potentially much more.
Everything still works if .meteor/versions is missing, or partially or
totally invalid, or mentions package versions that need to be fetched in
a catalog update first, etc.
- We don't want to do a bunch of parsing *per comparison* when sorting
a list of package version strings. package-version-parser's `compare`
(and server's `compare`, which it uses) both accept either a string
or a parsed record. By parsing explicitly with memoization, we avoid
a super-linear blow-up in the amount of parsing. This'll save someone
half a second, at least.
- Adjust profiling hooks and messages
- Expose `Profile` to isopackets
When we link files and annotate them with those right-justified line
number comments, it blows up the file size by 2-3x, increasing the time
to copy the files and even for Node to parse them. No user is ever
likely to see a raw generated server-side file, anyway.
There's no need to generate and parse a source map here, when the
`!smc` case is already handled below, and the header is already
taken into account.
Not sure why we ever added this:
e0fc1081b5
This helps performance quite a bit, taking what could otherwise be (say)
10 seconds down to a couple seconds in ImportScanner for an app that
imports a thousand files.
Bump up the crashCount reset delay from 3 seconds to 8 seconds.
If the delay is smaller than app start-up time, then an app that
crashes at start-up will be treated as an app that crashed while
running and will be automatically restarted, and this will lead to
an infinite loop of restarting. Making the delay longer just increases
the time right after app start where a crash counts towards the max of
three restarts in a row. For example, if we upped the delay to 60
seconds, then an app that crashed in its first minute would restart but
gain a crashCount of 1, and if there were two more crashes within the
first minute of running (without another crash *not* within the first
minute to reset the counter), the app would fail to automatically
restart.
This whole mechanism is a little janky and was written way way back.
The number 3 was previously 2, but app start-up got a little bit slower.
Hopefully the number 8 will last us until this code is replaced.
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.