Most performant way of converting int to string

Andrew Chapman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Dec 22 09:52:52 PST 2015


On Tuesday, 22 December 2015 at 17:43:00 UTC, H. S. Teoh wrote:

> I wonder if the slowdown is caused by GC collection cycles 
> (because calling to!string will allocate, and here you're 
> making a very large number of small allocations, which is known 
> to cause GC performance issues).
>
> Try inserting this before the loop:
>
> 	import core.memory;
> 	GC.disable();
>
> Does this make a difference in the running time?
>
>
> T

Thanks!  Unfortunately that actually makes it run slightly slower 
:-)


More information about the Digitalmars-d-learn mailing list