Project

General

Profile

Actions

Feature #14319

closed

[PATCH] zlib: reduce garbage on Zlib::GzipReader#readpartial

Feature #14319: [PATCH] zlib: reduce garbage on Zlib::GzipReader#readpartial

Added by normalperson (Eric Wong) almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:84660]

Description

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 <https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61631> Before:	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 After:	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 

Files

Updated by Anonymous almost 8 years ago Actions #1

  • Status changed from Open to Closed

Applied in changeset trunk|r61665.


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
https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61631

Before:

 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 

After:

 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]
Actions

Also available in: PDF Atom