Major performance problem with std.array.front()

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Mar 9 10:45:13 PDT 2014


On 3/9/14, 10:21 AM, Vladimir Panteleev wrote:
> On Sunday, 9 March 2014 at 17:18:47 UTC, Andrei Alexandrescu wrote:
>> On 3/9/14, 5:28 AM, Joseph Rushton Wakeling wrote:
>>> So IIUC iterating over s.byChar would not encounter the decoding-related
>>> speed hits that Walter is concerned about?
>>
>> That is correct.
>
> Unless I'm missing something, all algorithms that can work faster on
> arrays will need to be adapted to also recognize byChar-wrapped arrays,
> unwrap them, perform the fast array operation, and wrap them back in a
> byChar.

Good point. Off the top of my head I can't remember any algorithm that 
relies on array representation to do better on arrays than on 
random-access ranges offering all of arrays' primitives. But I'm sure 
there are a few.

Andrei



More information about the Digitalmars-d mailing list