aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2025-11-04 17:00:33 -0800
committerGopher Robot <gobot@golang.org>2026-01-15 10:35:56 -0800
commitbb7c0c717c8b3517210dce8f38cb2c91694af4e2 (patch)
treee97f7849dea3ecd44002c595c13d3d6d14cf7ca4 /test
parent2dcaaa751295597e1f603b7488c4624db6a84d2b (diff)
downloadgo-bb7c0c717c8b3517210dce8f38cb2c91694af4e2.tar.xz
archive/zip: reduce CPU usage in index construction
Constructing the zip index (which is done once when first opening a file in an archive) can consume large amounts of CPU when processing deeply-nested directory paths. Switch to a less inefficient algorithm. Thanks to Jakub Ciolek for reporting this issue. goos: darwin goarch: arm64 pkg: archive/zip cpu: Apple M4 Pro │ /tmp/bench.0 │ /tmp/bench.1 │ │ sec/op │ sec/op vs base │ ReaderOneDeepDir-14 25983.62m ± 2% 46.01m ± 2% -99.82% (p=0.000 n=8) ReaderManyDeepDirs-14 16.221 ± 1% 2.763 ± 6% -82.96% (p=0.000 n=8) ReaderManyShallowFiles-14 130.3m ± 1% 128.8m ± 2% -1.20% (p=0.003 n=8) geomean 3.801 253.9m -93.32% Fixes #77102 Fixes CVE-2025-61728 Change-Id: I2c9c864be01b2a2769eb67fbab1b250aeb8f6c42 Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3060 Reviewed-by: Nicholas Husin <husin@google.com> Reviewed-by: Neal Patel <nealpatel@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/736713 Auto-Submit: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions