X-Original-To: alpine-user@lists.alpinelinux.org Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) by lists.alpinelinux.org (Postfix) with ESMTP id 58DD05C4E9D for ; Tue, 13 Mar 2018 18:06:50 +0000 (GMT) Received: by sdaoden.eu (Postfix, from userid 1000) id C726A1604A; Tue, 13 Mar 2018 19:06:48 +0100 (CET) Date: Tue, 13 Mar 2018 19:06:48 +0100 From: Steffen Nurpmeso To: alpine-user@lists.alpinelinux.org Subject: [alpine-user] FYI: community/zstd binary much (up to 4x) slower than necessary Message-ID: <20180313180648.kXWsR%steffen@sdaoden.eu> Mail-Followup-To: alpine-user@lists.alpinelinux.org User-Agent: mail v14.9.9 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Mailinglist: alpine-user Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Hello, for your possible interest. In a thead for the LUGA(ustria) i eventually had to time some compression algorithms and wondered why zstd is so slow, but especially so the decompressing stage, which a key feature of this one. It turns out that the -Os compilation causes, well, drama- tical performance degradation. I compiled my own with -O3 and the difference is up to factor four. Just one example: POSIX standard (C165.txt): Alpine, -Os: #?0[steffen@essex tmp]$ time zstd --rm x4.txt x4.txt : 20.95% (12513780 => 2621685 bytes, x4.txt.zst) 0m00.57s real 0m00.23s user 0m00.12s system #?0[steffen@essex tmp]$ time zstd -d -c x4.txt.zst >/dev/null x4.txt.zst : 12513780 bytes 0m00.38s real 0m00.15s user 0m00.12s system #?0[steffen@essex tmp]$ time zstd --rm -19 x5.txt x5.txt : 15.40% (12513780 => 1926643 bytes, x5.txt.zst) 0m16.30s real 0m13.53s user 0m00.27s system #?0[steffen@essex tmp]$ time zstd -d -c x5.txt.zst >/dev/null x5.txt.zst : 12513780 bytes 0m00.39s real 0m00.12s user 0m00.14s system -O3: #?0[steffen@essex tmp]$ time x/zstd/zstd -f x1.txt x1.txt : 20.95% (12513780 => 2621685 bytes, x1.txt.zst) 0m00.34s real 0m00.12s user 0m00.10s system #?0[steffen@essex tmp]$ time x/zstd/zstd -d -c x1.txt.zst >/dev/null x1.txt.zst : 12513780 bytes 0m00.10s real 0m00.02s user 0m00.05s system #?0[steffen@essex tmp]$ time x/zstd/zstd -19 x1.txt x1.txt : 15.40% (12513780 => 1926643 bytes, x1.txt.zst) 0m13.29s real 0m11.27s user 0m00.17s system #?0[steffen@essex tmp]$ time x/zstd/zstd -d -c x1.txt.zst >/dev/null x1.txt.zst : 12513780 bytes 0m00.12s real 0m00.02s user 0m00.07s system That makes me actually wonder how ports should deal with CFLAGS. Is it acceptable for a port to watch for compiler flags and set them, my MUA would go for PIE, relro and all that, then? Ciao, --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) --- Unsubscribe: alpine-user+unsubscribe@lists.alpinelinux.org Help: alpine-user+help@lists.alpinelinux.org ---