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 11:37:20 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

Sorry, just getting back to this now...

To recap, od using xprintf gives this throughput:
$ timeout 2 od -Ax -tx1z -v /dev/zero | pv >/dev/null # 1.58MB/s

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

The rest of the time seems to be lost through the subsequent
call to snprintf, and I'm not sure how we can significantly improve that.
If we s/xprintf/printf/ in od.c for comparison, we get 10.7MB/s.

cheers,
Pádraig.

Attachment: vasnprintf-cache-alloc.diff
Description: Text Data


reply via email to

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