What's a good compression library for Java?

前端 未结 3 1878
故里飘歌
故里飘歌 2020-12-06 13:57

I need to compress portions of our application\'s network traffic for performance. I presume this means I need to stay away from some of the newer algorithms like bzip2, wh

3条回答
  •  鱼传尺愫
    2020-12-06 14:33

    Your compression algorithm depends on what your trying to optimize, and how much bandwidth you have available.

    If you're on a gigibit LAN, almost any compression algorithm is going to slow your program down just a bit. If your connecting over a WAN or internet, you can afford to do a bit more compression. If you connected to a dialup, you should compress as much as it absolutely possible.

    If this is a WAN, you may find hardware solutions like Riverbed's are more effective, as they work across a range of traffic, and don't require any changes to software.

    I have a test case which shows the relative compression difference between Deflate, Filtered, BZip2, and lzma. Simply plug in a sample of your data, and test the timing between two machines.

提交回复
热议问题