af126b8f0cf9ddc553a78869a3c820a4bd4fdc59 braney Mon Aug 17 13:36:13 2026 -0700 build: link the browser against zlib-ng instead of the system zlib, refs #38125 Adds zlib-ng as a second git submodule, alongside htslib, and points ZLIB at it. It is built with --zlib-compat, so the header and the symbol names are the ordinary zlib ones and no calling code has to change. Measured over the eight Recommended Track Set pages, hgTracks uses 29 percent less processor time and 26 percent less wall clock, and the image it produces is pixel identical. Writing the PNG is about three times faster and reading a bigBed data block about twice as fast, which is why the gain is larger than the image work alone would give. This also makes the platforms agree. x86_64 was linking a static /lib64/libz.a only because that file happened to be present, the arm64 Docker build fell through to a shared -lz, and Darwin was taking MacPorts zlib. All three now use the submodule. Verified on x86_64 Linux, aarch64 Linux and Apple silicon: zlib-ng builds, its own test suite passes, the makefiles pick it up, and bigBedToBed output is byte identical to before the change. diff --git src/submodules/zlib-ng src/submodules/zlib-ng new file mode 160000 index 00000000000..12731092979 --- /dev/null +++ src/submodules/zlib-ng @@ -0,0 +1 @@ +Subproject commit 12731092979c6d07f42da27da673a9f6c7b13586