List of Phobos functions that allocate memory?
Dmitry Olshansky
dmitry.olsh at gmail.com
Sat Feb 8 03:29:36 PST 2014
08-Feb-2014 12:20, Andrej Mitrovic пишет:
> On 2/7/14, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
>> However, I would argue that assuming that everyone is going to validate
>> their
>> strings and that pretty much all string-related functions shouldn't ever
>> have
>> to worry about invalid Unicode is just begging for subtle bugs all over the
>>
>> place IMHO.
>
> I suggested we would introduce an overload, not replace the existing
> function, so this isn't an issue.
>
>> The problem is that you need to check it. This is _slower_ than exceptions in
> the normal case, as invalid Unicode should be the rare case.
>
> Do you have any benchmarks for this? I have vague memory about
> complaining that the exception code is *de-facto* slower, regardless
> of input. But I'll try to provide some test-cases later and see where
> we're at.
>
Just be sure to test on LDC or GDC. DMD results are irrelevant to the
performance-minded of our community. Also be sure to copy the whole code
involved in a single file not link to Phobos.
People tend to thrown figures like ~10% slower with exceptions turned on
but you'll never known what exactly they test.
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list