Skip to content

Conversation

lukekarrys
Copy link
Contributor

@lukekarrys lukekarrys commented Apr 4, 2024

Tracking remaining todos here:

  • Add tests for display.js (was waiting for API to be stable enough)
  • Confirm timing file message is shown to users the same as previously
  • See if control chars can be stripped only from strings after util.format
  • Make forceLog respect silent
  • Fix cross platform snapshot tests
  • fix logs in arborist test

@H4ad
Copy link
Contributor

H4ad commented Apr 6, 2024

From what I saw, this will help the initialization like my refactoring for npmlog, and looks even faster by some ms.

One thing that I noticed you didn't call the set-blocking, this is needed to not truncate logs greater than 64Kb, but this dependency introduces 3~5ms of slowdown.

@lukekarrys lukekarrys changed the title wip: remove npmlog Refactor terminal display Apr 8, 2024
@lukekarrys lukekarrys marked this pull request as ready for review April 12, 2024 00:29
@lukekarrys lukekarrys requested a review from a team as a code owner April 12, 2024 00:29
@lukekarrys lukekarrys requested a review from wraithgar April 12, 2024 19:59
Copy link
Member

@wraithgar wraithgar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed this while still in draft mode, and reviewed changes as we went.

I also triple checked that we really do only need to strip C0 and C1 from strings now.

@lukekarrys lukekarrys merged commit 9622597 into latest Apr 12, 2024
@lukekarrys lukekarrys deleted the lk/remove-npmlog branch April 12, 2024 20:48
@github-actions github-actions bot mentioned this pull request Apr 12, 2024
@H4ad
Copy link
Contributor

H4ad commented Apr 12, 2024

With this PR merged:

$ hyperfine --warmup 3 "./bin/npm-cli.js run empty" "~/.asdf/installs/nodejs/21.6.2/bin/node ./bin/npm-cli.js run empty"
Benchmark 1: ./bin/npm-cli.js run empty
  Time (mean ± σ):     155.1 ms ±   1.3 ms    [User: 141.4 ms, System: 46.0 ms]
  Range (min … max):   152.1 ms … 157.0 ms    19 runs
 
Benchmark 2: ~/.asdf/installs/nodejs/21.6.2/bin/node ./bin/npm-cli.js run empty
  Time (mean ± σ):      77.2 ms ±   0.7 ms    [User: 71.0 ms, System: 17.8 ms]
  Range (min … max):    75.8 ms …  79.2 ms    38 runs
 
Summary
  '~/.asdf/installs/nodejs/21.6.2/bin/node ./bin/npm-cli.js run empty' ran
    2.01 ± 0.03 times faster than './bin/npm-cli.js run empty'

Great work!

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.

3 participants