From: Heesob Park Date: 2009-01-09T12:23:52+09:00 Subject: Re: Pure Ruby Zlib::GzipWriter 2009/1/8 Daniel Berger : > > > On Jan 7, 11:08 pm, "Heesob Park" wrote: >> Hi, >> >> 2009/1/8 Charles L. :> Daniel Berger wrote: >> >> >> Sounds like you're on track. But, you're in a race with Park Heesob. :) >> >> >> Dan >> >> > Heh. :) Somehow I think he's got it covered. That reimplementation of >> > zlib in ruby is actually pretty cool. I'm curious Park, as to how much >> > you did by hand and how much you were able to automate it...? >> >> I dit it all by hand. There is no royal road to translating C to Ruby:) >> >> > I've put the deflate code i wrote on pastie -http://pastie.org/355367 > > Excellent, thanks! > >> > It's about 600 lines, but needs cleaning up. Will probably be ~500 when >> > I've added in dynamic trees and cleaned it up a bit. >> >> > Prelim benchmarks show the current bottleneck to be the LZ77 >> > implementation which is interesting. I think for it to perform >> > acceptably, a lot more of the code needs to become more idiomatic, >> > higher-level ruby. >> >> In my test, the deflation is very slow but the inflation is endurable. >> Moreover, for the compatibility of the various Ruby version, It shows >> bad performance in Ruby 1.8.x. > > As long as it's usable I'm happy. We can benchmark, profile and > optimize later. :) > Finally I translated the whole zlib.c to ruby code. You can download at http://121.78.227.9/rbzlib/pzlib.rb Regards, Park Heesob