Wednesday 16 August 2017

Faster GZIP compression on the JVM

JVM compression benchmarks abound. Snappy and other compression libraries are often tagged as the go-to as they are quite a lot faster.

However, GZIP and the deflate algorithm is a very widely supported format with reasonably good performance. What if I told you you could get double the speed from gzip on Java?

Cloudflare have in fact done some excellent work tuning the open source zlib implementation, however this code is not available on the JVM, as it is a C library. The zlib implementation provided by Java is an older version, and overriding with LD_LIBRARY_PATH etc is not possible as the library is bundled.

Until now ..

I have packaged together some of the existing C and Java JNI code along with a few modifications, which allows you to call directly to an imported zlib library of your choosing! Include Cloudflare library for example and you will get more than 2x performance.

Benchmark results are excellent:
https://github.com/jasonk000/fastzlib

Benchmark                                Mode  Cnt   Score   Error  Units
BenchmarkCompressors.compressCloudflare  thrpt    5  43.760 ± 5.566  ops/s
BenchmarkCompressors.compressJvm         thrpt    5  19.533 ± 2.931  ops/s

12 comments:

  1. Nice post. I was checking constantly this blog and I am impressed! Extremely helpful information speciall development I care for such info a lot.
    wordpress development Sydney

    ReplyDelete
  2. All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
    Python Online certification training
    python Training institute in Chennai
    Python training institute in Bangalore

    ReplyDelete
  3. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
    AWS training in chennai

    AWS Training in Bangalore

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    Java training in chennai | Java training in bangalore | Java training in hyderabad | Java training in coimbatore | Java training in online

    ReplyDelete
  6. Nice blog, it’s so knowledgeable, informative, and good looking site. I appreciate your hard work. Good job. Thank you for this wonderful sharing with us. Keep Sharing.
    oracle training in chennai

    oracle training in tambaram

    oracle dba training in chennai

    oracle dba training in tambaram

    ccna training in chennai

    ccna training in tambaram

    seo training in chennai

    seo training in tambaram

    ReplyDelete
  7. I'm very much inspired when I've visited your blog. Your blog is really informative. Hope you will continue with new article.
    aws training in chennai
    aws course in chennai

    ReplyDelete
  8. I was examining some of your substance material cruelly this site and that I consider this net page is in actuality educational ! hold while motivation to setting occurring. Portraiture Full Crack

    ReplyDelete
  9. you have executed an uproarious errand upon this text. Its completely adjust and very subjective. you have even figured out how to make it decipherable and simple to make a get accord of into. you have a couple of precise composing competence. much obliged appropriately a lot. Birthday Wishes Lover

    ReplyDelete