prinft performance problem

David Nadlinger code at klickverbot.at
Tue Mar 18 13:34:03 PDT 2014


On Tue 18 Mar 2014 04:31:30 AM CET, bearophile wrote:
> I have reduced another performance problem, Windows 32 bit.
>
> A test C program: […]

LDC/Win32 uses the MinGW output/formatting functions, as e.g. the 
printf() from the MSCRT can't handle reals.

I don't really see a reason why the LDC-generated code should be that 
much slower otherwise (you can verify this by just calling 
__mingw_printf directly or I think also by passing the -posix/-ansi 
flags to GCC).

As to why the MinGW printf() is actually slower, no idea. Probably just 
a question of an optimized-to-hell version against a simple hack to 
make the C99 format specifiers work.

David


More information about the digitalmars-d-ldc mailing list