Skip to content
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

feat: timings are now written alongside debug log files #5581

Merged
merged 2 commits into from
Sep 27, 2022

Conversation

lukekarrys
Copy link
Contributor

BREAKING CHANGE: --timing file changes:

  • When run with the --timing flag, npm now writes timing data to a
    file alongside the debug log data, respecting the logs-dir option and
    falling back to the cache dir, instead of directly inside .npm/.
  • The timing file data is no longer newline delimited JSON, and instead
    each run will create a uniquely named <ID>-timing.json file, with the
    <ID> portion being the same as the debug log.
  • Finally, the data inside the file now has three top level keys,
    metadata, timers, and unfinishedTimers` instead of everything being
    a top level key.

Closes npm/statusboard#456

@npm-cli-bot
Copy link
Collaborator

npm-cli-bot commented Sep 23, 2022

found 20 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-large clean lock-only cache-only cache-only
peer-deps
modules-only no-lock no-cache no-modules no-clean no-clean
audit
npm@8 53.910 ±2.08 21.157 ±0.00 19.128 ±0.10 24.089 ±3.99 3.501 ±0.00 3.495 ±0.01 2.918 ±0.07 13.320 ±0.06 2.795 ±0.01 3.949 ±0.02
#5581 0.127 ±0.00 0.132 ±0.01 0.128 ±0.00 0.127 ±0.00 0.129 ±0.00 0.128 ±0.00 0.127 ±0.00 0.128 ±0.00 0.129 ±0.00 0.131 ±0.00
app-medium clean lock-only cache-only cache-only
peer-deps
modules-only no-lock no-cache no-modules no-clean no-clean
audit
npm@8 34.527 ±1.86 16.484 ±0.19 15.030 ±0.02 16.056 ±0.69 3.191 ±0.01 3.179 ±0.00 2.901 ±0.05 10.150 ±0.02 2.720 ±0.03 3.667 ±0.07
#5581 0.128 ±0.00 0.129 ±0.00 0.128 ±0.00 0.128 ±0.00 0.130 ±0.00 0.128 ±0.00 0.129 ±0.00 0.129 ±0.00 0.135 ±0.00 0.128 ±0.00

BREAKING CHANGE: `--timing` file changes:
- When run with the `--timing` flag, `npm` now writes timing data to a
file alongside the debug log data, respecting the `logs-dir` option and
falling back to `<CACHE>/_logs/` dir, instead of directly inside the
cache directory.
- The timing file data is no longer newline delimited JSON, and instead
each run will create a uniquely named `<ID>-timing.json` file, with the
`<ID>` portion being the same as the debug log.
- Finally, the data inside the file now has three top level keys,
`metadata`, `timers, and `unfinishedTimers` instead of everything being
a top level key.

Closes npm/statusboard#456
lib/npm.js Outdated Show resolved Hide resolved
Also refactor all files written to the logs directory to use the same
code path for file name creation.
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.

BREAKING CHANGE(logs): Write process specific timing file instead of newline delimited json in *_timing.json
3 participants