Skip to content

Conversation

@sjoerdsimons
Copy link
Contributor

golangs compress/gzip isn't a parallel implementation, so it's quite a
bit slower on most modern servers then pgzip. The below benchmark
run shows that publishing a debian bullseye mirror snapshot (amd64, arm64,
armhf, source) shows a gain of about 35% in publishing time (when skipping
bz2 using MR #1081)

 hyperfine -w 1 -m 3 -L aptly aptly-nobz2,aptly-nobz2-pgzip -p "{aptly} -config aptly.conf publish drop bullseye || true" "{aptly} -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye"
Benchmark 1: aptly-nobz2 -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye
  Time (mean ± σ):     35.548 s ±  0.378 s    [User: 39.465 s, System: 10.046 s]
  Range (min … max):   35.149 s … 35.902 s    3 runs

Benchmark 2: aptly-nobz2-pgzip -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye
  Time (mean ± σ):     26.592 s ±  0.069 s    [User: 42.207 s, System: 9.676 s]
  Range (min … max):   26.521 s … 26.660 s    3 runs

Summary
  'aptly-nobz2-pgzip -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye' ran
    1.34 ± 0.01 times faster than 'aptly-nobz2 -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye'

Signed-off-by: Sjoerd Simons sjoerd@collabora.com

@randombenj
Copy link
Contributor

Is this a fix for #1071 ?

@randombenj randombenj self-requested a review June 20, 2022 07:44
@sjoerdsimons
Copy link
Contributor Author

Is this a fix for #1071 ?

I think #1071 was specifically about speeding up .deb decompression by using parrallelism when creating content files. Where as this change is parallelizing compression of the index files (e.g. Packages.gz). So they seem orthogonal to me

Seems go.mod had some modules that are no longer used since the last
version bumps? Running `make modules` or really `go mod tidy`
automagically cleans those up.

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
golangs compress/gzip isn't a parallel implementation, so it's quite a
bit slower on most modern servers then pgzip. The below benchmark
run shows that publishing a debian bullseye mirror snapshot (amd64, arm64,
armhf, source) shows a gain of about 35% in publishing time (when skipping
bz2 using MR aptly-dev#1081)

```
 hyperfine -w 1 -m 3 -L aptly aptly-nobz2,aptly-nobz2-pgzip -p "{aptly} -config aptly.conf publish drop bullseye || true" "{aptly} -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye"
Benchmark 1: aptly-nobz2 -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye
  Time (mean ± σ):     35.548 s ±  0.378 s    [User: 39.465 s, System: 10.046 s]
  Range (min … max):   35.149 s … 35.902 s    3 runs

Benchmark 2: aptly-nobz2-pgzip -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye
  Time (mean ± σ):     26.592 s ±  0.069 s    [User: 42.207 s, System: 9.676 s]
  Range (min … max):   26.521 s … 26.660 s    3 runs

Summary
  'aptly-nobz2-pgzip -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye' ran
    1.34 ± 0.01 times faster than 'aptly-nobz2 -config aptly.conf  publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye'
```

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
@sjoerdsimons sjoerdsimons force-pushed the sjoerd/parallel-gzip branch from d190f7a to abb9280 Compare June 21, 2022 12:04
@sjoerdsimons
Copy link
Contributor Author

Fwiw to fix the merge conflict pushed in an extra commit to run go mod tidy first to avoid having odd changes in the actual functional commit

@codecov
Copy link

codecov bot commented Jun 21, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.15%. Comparing base (6f130e1) to head (abb9280).
Report is 479 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1082   +/-   ##
=======================================
  Coverage   52.15%   52.15%           
=======================================
  Files          73       73           
  Lines       11257    11257           
=======================================
  Hits         5871     5871           
  Misses       4822     4822           
  Partials      564      564           

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

@randombenj randombenj merged commit 2aca913 into aptly-dev:master Jun 21, 2022
@randombenj randombenj added this to the 1.5.0 milestone Jun 23, 2022
@neolynx
Copy link
Member

neolynx commented Jan 12, 2025

I think pgzip is not used everywhere, need to check also about xz...

@neolynx neolynx self-assigned this Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants