File I/O performance pitfalls

9898287 relay.public.adnan at outlook.com
Sat Oct 26 03:25:37 UTC 2019


On Saturday, 26 October 2019 at 02:42:04 UTC, rikki cattermole 
wrote:
> On 26/10/2019 2:27 PM, 9898287 wrote:
>> [...]
>
> You probably want -O3 not -O5.
>
>>  [...]
>
> I assume what you intended is:
> writeln("Hello, ", i);
>
> Also for format functions in D you should prefer the templated 
> variation as it provides compile time verification of arguments 
> e.g.
>
> writef!"Hello, {}\n%d"(i);
>
> Please note that {} is not a format specifier.
> printf style functions (which is what Phobos uses as the basis) 
> for format specifiers begin with a percentage sign.

Thank you for pointing that out.




More information about the Digitalmars-d-learn mailing list