bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vprintf performance


From: Pádraig Brady
Subject: Re: vprintf performance
Date: Fri, 04 Feb 2011 22:26:30 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 04/02/11 18:23, Bruno Haible wrote:
> Hi Pádraig,
> 
>> There was lots of heap interaction going on,
>> and by using the attached patch (only illustrative, may leak,
>> is not thread safe, ...) to cache the PRINTF_PARSE result
>> it increases the throughput to 5.8MB/s
> 
> Adding a global cache like this is hairy. Maybe we could get a
> speedup by letting the application allocate and manage a hash
> table that is used as a cache...?

Or provide a context variable so that's managed internally.
An interface change in any case :(

> Anyway, the immediate need to malloc() should be reduced with this patch.
> It trades malloc() against a bit more room on the stack. With it, I see
> a performance improvement in my test case of a factor 1.75. How much does
> it help on yours?

$ timeout 2 ./od -Ax -tx1z -v /dev/zero | pv >/dev/null
2.38MB 0:00:02 [1.21MB/s]

... | patch ....

$ timeout 2 ./od -Ax -tx1z -v /dev/zero | pv >/dev/null
 7.5MB 0:00:02 [3.85MB/s]

Thanks Bruno!

Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]