bug-gnulib
[Top][All Lists]
Advanced

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

vprintf performance


From: Pádraig Brady
Subject: vprintf performance
Date: Thu, 03 Feb 2011 10:02:51 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

I noticed od was very slow and traced it to it using xprintf:

$ timeout 2 od-xprintf -Ax -tx1z -v /dev/zero | pv >/dev/null
3.66MB 0:00:02 [1.86MB/s]
$ timeout 2 od-printf -Ax -tx1z -v /dev/zero | pv >/dev/null
19.6MB 0:00:02 [9.96MB/s]

The reason is because xprintf pulls in the whole gnulib vasnprintf
implementation, and then it does a huge number of reallocs.
So there are two possible issues; a redundant and slow replacement.

The reason my vprintf from glibc-2.12.90-21.i686 is not used is because:

$ grep gl_cv_func_printf.*no$ config.log
gl_cv_func_printf_infinite_long_double=no

I had a quick look at that check, and my suspicions are raised
as it was added in 2007. Is my glibc still not up to spec?
I extracted the test (attached) which output:

[0.000000e+4922] is not NAN
[0e+4922] is not NAN
[0.000000] is not NAN
[0.000000e+00] is not NAN
[0] is not NAN
[1.550000] is not NAN
[1.550000e+00] is not NAN
[1.55] is not NAN
[0.000000] is not NAN
[8.405258e-4934] is not NAN
[8.40526e-4934] is not NAN

cheers,
Pádraig.

Attachment: ild.c
Description: Text Data


reply via email to

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