mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-05 05:20:34 +00:00
Allow disabling bzip2 compression for index files
Using bzip2 generates smaller index files (roughly 20% smaller Packages
files) but it comes with a big performance penalty. When publishing a
debian mirror snapshot (amd64, arm64, armhf, source) without contents
skipping bzip speeds things up around 1.8 times.
```
$ hyperfine -w 1 -L skip-bz2 true,false -m 3 -p "aptly -config aptly.conf publish drop bullseye || true" "aptly -config aptly.conf publish snapshot --skip-bz2={skip-bz2} --skip-contents --skip-signing bullseye"
Benchmark 1: aptly -config aptly.conf publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye
Time (mean ± σ): 35.567 s ± 0.307 s [User: 39.366 s, System: 10.075 s]
Range (min … max): 35.311 s … 35.907 s 3 runs
Benchmark 2: aptly -config aptly.conf publish snapshot --skip-bz2=false --skip-contents --skip-signing bullseye
Time (mean ± σ): 64.740 s ± 0.135 s [User: 68.565 s, System: 10.129 s]
Range (min … max): 64.596 s … 64.862 s 3 runs
Summary
'aptly -config aptly.conf publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye' ran
1.82 ± 0.02 times faster than 'aptly -config aptly.conf publish snapshot --skip-bz2=false --skip-contents --skip-signing bullseye'
```
Allow skipping bz2 creation for setups where faster publishing is more
important then Package file size.
Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
This commit is contained in:
committed by
Benj Fassbind
parent
2aca913e92
commit
f61514edaf
@@ -96,6 +96,7 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
|
||||
ButAutomaticUpgrades string
|
||||
ForceOverwrite bool
|
||||
SkipContents *bool
|
||||
SkipBz2 *bool
|
||||
Architectures []string
|
||||
Signing SigningOptions
|
||||
AcquireByHash *bool
|
||||
@@ -209,6 +210,11 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
|
||||
published.SkipContents = *b.SkipContents
|
||||
}
|
||||
|
||||
published.SkipBz2 = context.Config().SkipBz2Publishing
|
||||
if b.SkipContents != nil {
|
||||
published.SkipBz2 = *b.SkipBz2
|
||||
}
|
||||
|
||||
if b.AcquireByHash != nil {
|
||||
published.AcquireByHash = *b.AcquireByHash
|
||||
}
|
||||
@@ -243,6 +249,7 @@ func apiPublishUpdateSwitch(c *gin.Context) {
|
||||
ForceOverwrite bool
|
||||
Signing SigningOptions
|
||||
SkipContents *bool
|
||||
SkipBz2 *bool
|
||||
SkipCleanup *bool
|
||||
Snapshots []struct {
|
||||
Component string `binding:"required"`
|
||||
@@ -322,6 +329,10 @@ func apiPublishUpdateSwitch(c *gin.Context) {
|
||||
published.SkipContents = *b.SkipContents
|
||||
}
|
||||
|
||||
if b.SkipBz2 != nil {
|
||||
published.SkipBz2 = *b.SkipBz2
|
||||
}
|
||||
|
||||
if b.AcquireByHash != nil {
|
||||
published.AcquireByHash = *b.AcquireByHash
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user