🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
1 messages
1 total messages Started by Richard Oliver Tue, 03 Nov 2026 13:50
Bug#1070168: zstd: Poor performance of Debian build
#3142
Author: Richard Oliver
Date: Tue, 03 Nov 2026 13:50
55 lines
4614 bytes
Control: tags -1 + patch
Control: found -1 1.5.7+dfsg-4

Dear Maintainer,

I believe I have found the cause: /usr/bin/zstd is a debug build. During
dh_auto_test, "make test" runs tests/Makefile, which exports DEBUGLEVEL=2 and
rebuilds programs/zstd in place; dh_auto_install then ships that binary.
libzstd1 is not affected.

To confirm:

    grep -c -aF '0<=level && level<=4' /usr/bin/zstd                         # assert()
    grep -c -aF 'ZSTD_compressBlock_internal (dstCapacity=' /usr/bin/zstd   # DEBUGLOG

Both are non-zero on the archive binary and 0 on a release build. With
symbols from debuginfod.debian.net, gdb shows g_debuglevel = 2.

All 1.5.7 builds I checked (-1 and -4, amd64 and arm64) are affected;
bookworm's 1.5.4 and bullseye's 1.4.8 also contain assert() strings.

On arm64 (Raspberry Pi 5, Silesia corpus) the archive binary is 7-25% slower
to compress and 10-13% slower to decompress than a release build of the same
source, which matches the reports above.

The patch below applies to 1.5.7+dfsg-4. Verified on 1.5.7+dfsg-1 with a
full "dpkg-buildpackage -rfakeroot" including tests (all 40 pass); the shipped
binary matches the nocheck build.

--- a/debian/rules
+++ b/debian/rules
@@ -52,6 +52,15 @@
 execute_after_dh_auto_build:
 	dh_auto_build -D contrib/pzstd

+# The upstream test suite rebuilds programs/zstd in place with DEBUGLEVEL=2
+# (assert() and DEBUGLOG enabled), which dh_auto_install would then ship.
+# Keep the release binary aside and put it back once the tests have run.
+execute_before_dh_auto_test:
+	cp -p programs/zstd debian/zstd.release
+
+execute_after_dh_auto_test:
+	cp -p debian/zstd.release programs/zstd
+
 override_dh_auto_install:
 	dh_auto_install -- libdir=/usr/lib/${DEB_HOST_MULTIARCH}
 	dh_auto_install -D contrib/pzstd
--- a/debian/clean
+++ b/debian/clean
@@ -1 +1,2 @@
 tests/cli-tests/bin/symlinks/
+debian/zstd.release

Kind regards,
Richard Oliver
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads