A fairy tale of zlib/zip compression in OpenJDK
summary
Explains how OpenJDK bundles zlib, when it statically links versus using the system zlib, and how to swap implementations with LD_PRELOAD alternative zlib; shows benchmarks where Intel‑tuned libraries reach 4–6× faster on some Intel workloads for inflate/deflate and describes CRC32/CRC32C intrinsics to speed small reads. Demonstrates a real bug where optimized inflaters write padding past the last byte causing ASM/Spring corruption and how it is resolved (inflater writes padding bug fixed in JDK19/20), plus Java rework of ZipFile (JDK9) and compressed‑size fixes (JDK16).
AI-written summary · about
chapters (19)
- 0:00Intro
- 0:27About me
- 2:02What is deflate
- 2:30zlib
- 3:11gzip
- 3:49zip
- 4:33history
- 5:11zip API
- 5:53jar file
- 6:29change lock
- 6:56zlib integration
- 8:50zip file support
- 11:20dictionarybased compression
- 15:02Huffman compression
- 18:30Dflat
- 26:26Dynamic vs Static linking
- 30:34Issues
- 36:38Fix
- 45:31Conclusion
related talks
41mUp and Away: JDK Optimizations
51mAccelerating performance of Java applications on Arm64
48mJava in Containers - Part Deux
53mJava Performance Update 2024
44mIncremental Improvements to the Java Platform
48mJust-In-Time Compilation for Java Performance: Recent and Ongoing Improvements
41mJava 24, Faster Than Ever
35mJava at Speed: Building a Better JVM
