Skip to content

Commit 2b20434

Browse files
committed
perf(bundle): bump default zstd level 7 → 19
Measured on real production-shape bundles (~570 KB at level 7, 7 runs × 2192 hourly portfolio snapshots each): level 7 → ~570 KB level 19 → ~489 KB (−14%) level 22 → ~489 KB (saturated) Decode speed is unchanged in zstd's design (decoder is independent of encoder level). For a 12,500-bundle workload (~64 GB at level 7) this trims the archive to ~55 GB at zero behavioural cost. Level 19 is the highest level still in the standard tier (no --ultra flag, no special memory window), so the bytes are readable by any stock zstd reader.
1 parent 0466a34 commit 2b20434

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • investing_algorithm_framework/domain/backtesting

investing_algorithm_framework/domain/backtesting/bundle.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@
5959
BUNDLE_FORMAT_VERSION = 2
6060
BUNDLE_EXT = ".iafbt"
6161

62-
# ``zstd`` compression level. Level 7 is a sweet spot: ~6-8x on the
63-
# typical run.json/metrics.json payload, ~10ms encode for a 17MB doc.
64-
_ZSTD_LEVEL = 7
62+
# ``zstd`` compression level. Level 19 is the highest level still in
63+
# the "fast" tier (i.e. without ``--ultra``). Measured on real
64+
# 7-run/2192-snapshot bundles it cuts ~14% off the on-disk size vs
65+
# level 7 with no observable decode-speed impact, and is what we
66+
# default to since the v8.9 size review.
67+
_ZSTD_LEVEL = 19
6568

6669
# Header used to detect bundle files cheaply without decoding.
6770
# 4 bytes magic ("IAFB") + 4 bytes little-endian uint32 format version.

0 commit comments

Comments
 (0)