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

perf: fetch abbreviated metadata #241

Merged
merged 1 commit into from
Sep 26, 2024
Merged

perf: fetch abbreviated metadata #241

merged 1 commit into from
Sep 26, 2024

Conversation

KSXGitHub
Copy link
Contributor

This simple change surprisingly improves performance by about 10%.

cargo run --bin=integrated-benchmark -- -s frozen-lockfile HEAD main -V -D ./crates/testing-utils/src/fixtures/big/
Benchmark 1: pacquet@HEAD
  Time (mean ± σ):      3.036 s ±  0.291 s    [User: 14.522 s, System: 17.387 s]
  Range (min … max):    2.673 s …  3.516 s    10 runs
 
Benchmark 2: pacquet@main
  Time (mean ± σ):      3.137 s ±  0.275 s    [User: 14.616 s, System: 17.753 s]
  Range (min … max):    2.584 s …  3.492 s    10 runs
 
Summary
  pacquet@HEAD ran
    1.03 ± 0.13 times faster than pacquet@main

It is still not as fast as pnpm. It is likely that there are other optimizations pnpm did that I'm not aware of.

@KSXGitHub KSXGitHub requested a review from zkochan September 26, 2024 10:08
Copy link

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
tarball/download_dependency    1.00      7.2±0.33ms   599.2 KB/sec    1.00      7.2±0.22ms   600.9 KB/sec

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.75%. Comparing base (5dcb687) to head (51bb919).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
+ Coverage   92.68%   92.75%   +0.06%     
==========================================
  Files          59       59              
  Lines        2872     2884      +12     
==========================================
+ Hits         2662     2675      +13     
+ Misses        210      209       -1     
Flag Coverage Δ
92.75% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Integrated-Benchmark Report (Linux)

Scenario: Frozen Lockfile

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 131.3 ± 11.0 116.6 150.8 1.01 ± 0.12
pacquet@main 129.5 ± 10.2 110.3 145.8 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1313476245857143,
      "stddev": 0.010983900584432285,
      "median": 0.12713331780000003,
      "user": 0.06233629428571428,
      "system": 0.20832744285714283,
      "min": 0.11660323730000001,
      "max": 0.15081100630000002,
      "times": [
        0.14707746530000002,
        0.15081100630000002,
        0.1269856903,
        0.12728094530000003,
        0.14189809030000003,
        0.12665808030000003,
        0.11660323730000001,
        0.13947360330000003,
        0.1211258343,
        0.14079520530000003,
        0.1220021673,
        0.13471932830000002,
        0.1192741243,
        0.12416196630000001
      ],
      "exit_codes": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.12946160298750004,
      "stddev": 0.010204349089783524,
      "median": 0.1276203058,
      "user": 0.0619152675,
      "system": 0.21021442499999998,
      "min": 0.1103118813,
      "max": 0.14576961630000002,
      "times": [
        0.1279217233,
        0.1381005623,
        0.12305621030000001,
        0.14576961630000002,
        0.11915629330000001,
        0.13275554030000003,
        0.1214262843,
        0.14266804030000002,
        0.11956121230000001,
        0.12592348930000002,
        0.14060210430000003,
        0.12731888830000002,
        0.1322369663,
        0.1103118813,
        0.14209372030000003,
        0.1224831153
      ],
      "exit_codes": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]
    }
  ]
}

@zkochan zkochan merged commit d0bbbb4 into main Sep 26, 2024
13 checks passed
@zkochan zkochan deleted the abbreviated-json branch September 26, 2024 10:39
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.

2 participants