A patch implementing Zlib decompression (with GZip decompression support) as a built in library has been submitted to RubyForge: http://rubyforge.org/tracker/index.php?func=detail&aid=19711&group_id=4359&atid=16800 . It''s quite a bit faster then trying to use Zliby (this is essentially a port of that). It works, though binary files seem to be causing some problem, I suspect it''s because of the differences in Unicode Strings in the CLR vs non-Unicode strings in ruby 1.8.6. Anyway, it''s a start. -- Michael Letterle [Polymath Prokrammer] http://blog.prokrams.com
John Lam (IRONRUBY)
2008-Apr-23 00:08 UTC
[Ironruby-core] "Native" Zlib Implementation Patch
Michael Letterle:> "Native" Zlib Implementation PatchThanks for sending this in! FYI - a few quick pointers about your contribution. No need to take any action since I''ve fixed most of them on my machine already. 1. Bangs Please do your best to incorporate the bangs in your contributions. The bangs indicate a non-nullable reference type. I find that it''s best if you create a VS macro to insert them - I bind this macro to the CTRL-! key: Sub InsertBang() DTE.ActiveDocument.Selection.Text = "/*!*/" End Sub This helps to reinforce in your mind (and in the mind of the code reviewer) whether a given reference type is non-nullable or not. This will also greatly help us out when we start running spec# for real across our codebase to look for violations of this contract. Generally you''ll find that any time you get a CodeContext from us it''s guaranteed to not be null, which means that you don''t have to do a null check. The converse is also true - if you have a nullable reference type, you''ll need to validate it with one of the helpers in our Microsoft.Scripting.ContractUtils class. 2. General formatting issues Please do try and stick with .NET naming conventions if possible when porting code from Java etc. I realize that it does take time to do this, and thanks, but it''s either you do it or I have to :) Not a big deal since I can just do a CTRL-K CTRL-F on your code, but it would rock if you could format along the same lines as the rest of the code. 3. Testing / coverage If possible please let us know how many specs from the spec suite your code passes etc. That would help us determine how much to look into the codebase itself. Thanks, -John
The rubinius specs for Zlib are... wanting. Though there are some. Are the rubinius specs used as is? On Tue, Apr 22, 2008 at 8:08 PM, John Lam (IRONRUBY) <jflam at microsoft.com> wrote:> Michael Letterle: > > > "Native" Zlib Implementation Patch > > Thanks for sending this in! > > FYI - a few quick pointers about your contribution. No need to take any action since I''ve fixed most of them on my machine already. > > 1. Bangs > > Please do your best to incorporate the bangs in your contributions. The bangs indicate a non-nullable reference type. I find that it''s best if you create a VS macro to insert them - I bind this macro to the CTRL-! key: > > Sub InsertBang() > DTE.ActiveDocument.Selection.Text = "/*!*/" > End Sub > > This helps to reinforce in your mind (and in the mind of the code reviewer) whether a given reference type is non-nullable or not. This will also greatly help us out when we start running spec# for real across our codebase to look for violations of this contract. > > Generally you''ll find that any time you get a CodeContext from us it''s guaranteed to not be null, which means that you don''t have to do a null check. The converse is also true - if you have a nullable reference type, you''ll need to validate it with one of the helpers in our Microsoft.Scripting.ContractUtils class. > > 2. General formatting issues > > Please do try and stick with .NET naming conventions if possible when porting code from Java etc. I realize that it does take time to do this, and thanks, but it''s either you do it or I have to :) Not a big deal since I can just do a CTRL-K CTRL-F on your code, but it would rock if you could format along the same lines as the rest of the code. > > 3. Testing / coverage > > If possible please let us know how many specs from the spec suite your code passes etc. That would help us determine how much to look into the codebase itself. > > Thanks, > -John > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-- Michael Letterle [Polymath Prokrammer] http://blog.prokrams.com
John Lam (IRONRUBY)
2008-Apr-23 03:23 UTC
[Ironruby-core] "Native" Zlib Implementation Patch
Michael Letterle:> > The rubinius specs for Zlib are... wanting. Though there are some. > Are the rubinius specs used as is? >Just peeked at the latest rubinius specs and there is some coverage. I''m going to start working on running the latest rubinius spec runner in my next checkin. -John