[PATCH] Add a gzip fastpath for the xmalloc readers, v2

Lauri Kasanen curaga at operamail.com
Fri Nov 28 09:44:41 UTC 2014


v2: Add missing check on open

The performance and number of processes for a "depmod -a" with gzipped
modules was abysmal. This patch adds a fast path without fork for well-
behaved gzip files, benefiting all users of xmalloc_open_zipped_read_close.

"modinfo radeon.ko.gz", a single-file reader, got 30% faster.
"depmod -a", which used to fork over 800 times, got 20% faster. And of course
a whole lot less processes -> much saved RAM.

function                                             old     new   delta
inflate_get_next_window                                -    1877   +1877
xmalloc_unpack_gz                                      -     356    +356
check_header_gzip                                      -     298    +298
xmalloc_inflate_unzip_internal                         -     223    +223
xmalloc_open_zipped_read_close                        73     176    +103
inflate_init                                           -      97     +97
inflate_store_unused                                   -      35     +35
unpack_gz_stream                                     567     299    -268
inflate_unzip_internal                              2304     172   -2132
------------------------------------------------------------------------------
(add/remove: 6/0 grow/shrink: 1/2 up/down: 2989/-2400)        Total: 589 bytes

-- 
http://www.fastmail.com - The way an email service should be

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Add-a-gzip-fastpath-for-the-xmalloc-readers.patch
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20141128/ba7017ef/attachment.ksh>


More information about the busybox mailing list