Slower than Python

Steven Schveighoffer schveiguy at yahoo.com
Fri Mar 1 15:22:54 PST 2013


On Fri, 01 Mar 2013 18:07:45 -0500, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 3/1/13 5:47 PM, Steven Schveighoffer wrote:
>> On Fri, 01 Mar 2013 17:35:04 -0500, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> On 3/1/13 5:31 PM, Steven Schveighoffer wrote:
>>>> Phobos kind of refuses to treat strings like arrays of characters, it
>>>> insists on decoding.
>>>
>>> There's no decoding in find and splitter as far as I remember.
>>
>> Looking at splitter, it uses skipOver to skip over the separator, and
>> that seems to call R.front and R.popFront. Actually, it calls it for
>> both the source string and the separator.
>
> You may be looking at the wrong splitter overload.

Yes, I was.  Very difficult to tell with the way template constraints are  
written!

So it's just pure heuristics.  Not hard to see how that would affect a 10  
million cycle program.

We may be able to create a string-specific version of splitter that would  
take advantage of the representation.

-Steve


More information about the Digitalmars-d mailing list