List of Phobos functions that allocate memory?

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Feb 7 12:51:50 PST 2014


07-Feb-2014 23:45, Walter Bright пишет:
> On 2/7/2014 7:33 AM, Adam D. Ruppe wrote:
>> On Friday, 7 February 2014 at 11:37:16 UTC, Ola Fosheim Grøstad wrote:
>>> How slow is slow? Is it slower than in Go and Python?
>>
>> One problem with allocating the exception is the stop-the-world thing. My
>> cgi.d's built in httpd does some allocations in its constructor, which
>> is run
>> once per request. It can answer requests at a rate of about 6000/sec
>> on my
>> computer...
>
> The gc is not the real speed issue with exceptions, after all, one can
> preallocate the exception:
>
>      throw new Exception();
>
>            v.s.
>
>      e = new Exception();
>      ...
>      throw e;
>

And the standard library basically can't do this for every function.

> It's the unwinding speed. Just have a look at what deh2.d has to do.

It's deh.d or rather deh_win32./ deh_win64_posix.d and it doesn't look 
like _all_ that lot especially if you have no finally blocks and the 
only catch is the top-most catch-all.

After all error codes would also have to propagate up the same call 
stack depth.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list