koraktor / rbzip2

bzip2 for Ruby
BSD 3-Clause "New" or "Revised" License
40 stars 10 forks source link

Very bad performance of JRuby 1.7.4 #2

Closed adriantoman closed 7 years ago

adriantoman commented 10 years ago

I am trying to use this gem under JRuby 1.7.4 for decompressing file compressed in bzip2.

The size of compressed file is 422Kb. The decompressed file have 7.9M. Decompression by bzip2 in Linux take less than 1s.

When I am using the gem, the part of code RBzip2::Decompressor.new file take around 30s and the read part take more than 30mins ( yes minutes ). During the decompression Jruby process is taking 100% of one core on my PC. I am running it on Fedora 16. Java version 1.7.0.

koraktor commented 10 years ago

Please have a look at the Performance section of the README. This library is plain Ruby code without any optimizations and is only suitable for the most minimal scenarios, e.g. decompressing TCP/UDP packets.

Please have a look at the current code in the master branch. It contains code to work with FFI and Apache Commons Compress which should work much better on JRuby.

adriantoman commented 10 years ago

Thank you, i will try it right now.

adriantoman commented 10 years ago

It looks like that performance is still very bad ... I don't see any change after installing gem from master.

koraktor commented 10 years ago

You'll have to make sure that Commons Compress is in your classpath.

You can also check this using RBzip2::Java.available?.

koraktor commented 7 years ago

Closing this. Please reopen if you still see bad performance with version 0.3.0 (and Commons Compress).