[Performance] Why D's std.string.atoi is 4x slower than std.c.stdlib.atoi?

Walter Bright newshound at digitalmars.com
Sat Nov 11 12:36:09 PST 2006


Andrey Khropov wrote:
> Why is it so? What could be done?

The implementation of std.string.atoi is:

long atoi(char[] s)
{
     return std.c.stdlib.atoi(toStringz(s));
}

In other words, it's the allocation/copy done by toStringz.



More information about the Digitalmars-d mailing list