From be9f38bf6c7c228bc0d749703060228b16793167 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Fri, 2 May 2014 01:23:21 +0100 Subject: 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. * src/numfmt.c (devmsg): Move the inline function with _internal_ enablement check to... * src/system.h: ...here as a variadic macro, with the enablement check at the outer level. * src/factor.c: As per numfmt.c but there is no performance change in this case. * NEWS: Mention the significant performance improvement. --- src/system.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/system.h') diff --git a/src/system.h b/src/system.h index a9588e779..f295ad1c2 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 \ { \ -- cgit v1.2.3-54-g00ecf