coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] numfmt: improve processing throughput by 800%


From: Pádraig Brady
Subject: Re: [PATCH] numfmt: improve processing throughput by 800%
Date: Fri, 02 May 2014 13:05:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 05/02/2014 12:30 PM, Bernhard Voelker wrote:
> On 05/02/2014 02:58 AM, Pádraig Brady wrote:
>> [PATCH] numfmt: improve processing throughput by 800%
>>
>> The devmsg() calls that took quote_n() arguments,
>> didn't normally output anything, but still incurred
>> the overhead of those quote_n() calls.
> 
> Good catch, I also thought about that yesterday.
> 
>> diff --git a/src/system.h b/src/system.h
>> index a9588e7..f295ad1 100644
>> --- a/src/system.h
>> +++ b/src/system.h
>> @@ -617,6 +617,16 @@ usable_st_size (struct stat const *sb)
>>
>>   void usage (int status) ATTRIBUTE_NORETURN;
>>
>> +/* Like error(0, 0, ...), but without an implicit newline.
>> +   Also a noop unless the global DEV_DEBUG is set.  */
>> +#define devmsg(...)            \
>> +  do                    \
>> +    {                    \
>> +      if (dev_debug)            \
>> +        fprintf (stderr, __VA_ARGS__);    \
>> +    }                    \
>> +  while (0)
>> +
>>   #define emit_cycle_warning(file_name)    \
>>     do                    \
>>       {                    \
>>
> 
> Can we be sure the __VA_ARGS__ macro works everywhere?
> It is also used in factor.c, nowhere else.

__VA_ARGS_ is a C99 standard, and this feature seems well supported.
factor had no issue, though that is used in a restricted
context of systems with older GMP.  Anyway lets go with the
15 year old standard. Older systems can jump through the
hoops rather than us.

thanks again for the review.

Pádraig.




reply via email to

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