-
Notifications
You must be signed in to change notification settings - Fork 21
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
refactor: parse integrity eagerly #180
Conversation
The parsing of integrity has been moved from tarball to serde
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #180 +/- ##
==========================================
+ Coverage 86.43% 86.57% +0.14%
==========================================
Files 56 56
Lines 2838 2838
==========================================
+ Hits 2453 2457 +4
+ Misses 385 381 -4
☔ View full report in Codecov by Sentry. |
Micro-Benchmark ResultsLinux
|
Integrated-Benchmark Report (Linux)Scenario: Frozen Lockfile
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.17636004956181822,
"stddev": 0.01819579514305167,
"median": 0.17863561538,
"user": 0.06561736363636364,
"system": 0.10443953636363634,
"min": 0.15511080538,
"max": 0.20672168638000002,
"times": [
0.20672168638000002,
0.18301107438,
0.16200419638000002,
0.19465632638000002,
0.15600871738,
0.15934356138,
0.17863561538,
0.16270830638,
0.19509193338,
0.15511080538,
0.18666832238
],
"exit_codes": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
{
"command": "pacquet@main",
"mean": 0.16841788963,
"stddev": 0.01289534887685345,
"median": 0.17170057438000003,
"user": 0.07033483333333333,
"system": 0.10532973333333333,
"min": 0.14424006238,
"max": 0.18739573138,
"times": [
0.18739573138,
0.17773210438,
0.17583537938000002,
0.17790610638,
0.15361618638000002,
0.17101491538000002,
0.15448039738,
0.17238623338,
0.14424006238,
0.17972633038000002,
0.15901685738000002,
0.16766437138
],
"exit_codes": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
]
} |
crates/lockfile/src/resolution.rs
Outdated
LockfileResolution::Tarball(resolution) => resolution.integrity.as_ref(), | ||
LockfileResolution::Registry(resolution) => resolution.integrity.pipe_ref(Some), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same as this?
LockfileResolution::Tarball(resolution) => resolution.integrity.as_ref(), | |
LockfileResolution::Registry(resolution) => resolution.integrity.pipe_ref(Some), | |
LockfileResolution::Tarball(resolution) => &resolution.integrity, | |
LockfileResolution::Registry(resolution) => Some(&resolution.integrity), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zkochan You're right on the second line. The first line is not the same. Option::as_ref
is a method that converts &Option<T>
to Option<&T>
.
The parsing of integrity has been moved from tarball to serde.