When to prefer formatValue over formattedWrite?

Per Nordlöw per.nordlow at gmail.com
Tue Feb 19 12:09:12 UTC 2019


On Tuesday, 19 February 2019 at 11:40:09 UTC, Per Nordlöw wrote:
> Is `formatValue` more lightweight to the compiler?

I already posted a very similar question at

https://forum.dlang.org/post/xsovipkjyjyumtyzmwqi@forum.dlang.org

but in this thread I'm interested in knowing if is there is any 
significant difference in compilation-speed and if formatValue 
and/or formattedWrite needs to allocate using the GC when we are 
writing a array of `char`s or a long, directly to standard 
output. In theory the string could be written directly to stdout 
without an extra memory buffer and the `long` could be formatted 
to a temporarily (stack) allocated array of `char`s before 
written to standard output.


More information about the Digitalmars-d-learn mailing list