airlift / aircompressor

A port of Snappy, LZO, LZ4, and Zstandard to Java
Apache License 2.0
549 stars 110 forks source link

ZStd JNI vs Aircompressor pure java performance question #174

Open nknize opened 11 months ago

nknize commented 11 months ago

OpenSearch is evaluating the pure java implementation of Zstd using AirCompressor. I stumbled on a thoughtful comment here which certainly aligns to the reasons we avoid jni code as "top level" modules or plugins on OpenSearch core (we have similar reasons on Lucene). We realize that comment is now five years old, and so @reta ran benchmarks that seem to show significant performance differences between the pure java implementation (hotspot has gotten better of course) and jni. Do these number look valid to folks on this project? What are the potential pitfalls to running those benchmarks that we need to be aware of? Are there certain config conditions that should be followed to squeeze better performance?

Thanks in advance for any assistance that can be provided.

reta commented 11 months ago

For context, I run the io.airlift.compress.benchmark.CompressionBenchmark (i7-10750H × 12, 64Gb, Linux/Ubuntu, JDK 17.0.8), no modifications, selectively picked the airlift_zstd / zstd_jni since this is what we've been looking for, thank you.

nknize commented 10 months ago

Quick ping check in on this... any maintainers here able to give some guidance?

tianjiqx commented 3 months ago

image

Perhaps I have the same test results and found that zstd_jni actually performs better. The same implementation of Lz4 also results in better performance for JNI.

2024-04-18_15-53

Jdk: 17 Os: ubuntu22.04 CPU: AMD ® Ryzen 7 7840hs