Most performant way of converting int to string

Daniel Kozák via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Dec 22 11:53:14 PST 2015


V Tue, 22 Dec 2015 17:15:27 +0000
Andrew Chapman via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> napsáno:

> Sorry if this is a silly question but is the to! method from the 
> conv library the most efficient way of converting an integer 
> value to a string?
> 
> e.g.
> string s = to!string(100);
> 
> I'm seeing a pretty dramatic slow down in my code when I use a 
> conversion like this (when looped over 10 million iterations for 
> benchmarking).
> 
> Cheers!
> 
> 

This is OK and expected :).



More information about the Digitalmars-d-learn mailing list