[ruby-cvs:68846] normal:r61665 (trunk): zlib: reduce garbage on Zlib::GzipReader#readpartial

normal at ruby-lang.org normal at ruby-lang.org
Mon Jan 8 10:11:38 JST 2018

normal	2018-01-08 10:11:38 +0900 (Mon, 08 Jan 2018)

  New Revision: 61665


    zlib: reduce garbage on Zlib::GzipReader#readpartial
    For garbage-concious users who use the `outbuf' argument of
    `readpartial' to supply a destination buffer, this provides
    a drastic reduction in garbage when inflating large inputs
    in a streaming fashion.
    This results in a anonymous RSS reduction in the reader
    similar to the reduction in the writer from r61631.
    Results using the test script from r61631
            writer   7.359999   0.000000   7.359999 (  7.360639)
            writer RssAnon:     4040 kB
            reader   6.346667   0.070000   6.416667 (  7.387654)
            reader RssAnon:    98272 kB
            writer   7.309999   0.000000   7.309999 (  7.310651)
            writer RssAnon:	    4048 kB
            reader   6.146666   0.003333   6.149999 (  7.334868)
            reader RssAnon:	    4300 kB
    * ext/zlib/zlib.c (struct read_raw_arg): new struct
      (gzfile_read_raw_partial): use read_raw_arg
      (gzfile_read_raw_rescue): ditto
      (gzfile_read_raw): accept outbuf, use read_raw_arg
      (gzfile_read_raw_ensure): accept outbuf
      (gzfile_read_header): ditto
      (gzfile_check_footer): ditto
      (gzfile_read_more): ditto
      (gzfile_read_raw_until_zero): adjust for changes
      (gzfile_fill): ditto
      (gzfile_readpartial): ditto
      (gzfile_read_all): ditto
      (gzfile_getc): ditto
      (gzfile_reader_end_run): ditto
      (gzfile_reader_get_unused): ditto
      (rb_gzreader_initialize): ditto
      (gzreader_skip_linebreaks): ditto
      (gzreader_gets): ditto
      (zlib_gunzip_run): ditto
      [ruby-core:84660] [Feature #14319]

  Modified files:

More information about the ruby-cvs mailing list