Slower than Python

Steven Schveighoffer schveiguy at yahoo.com
Sat Mar 2 14:48:28 PST 2013


On Sat, 02 Mar 2013 16:16:22 -0500, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> I fear there's a misunderstanding somewhere. Splitter and find are  
> already specialized appropriately for strings.

OK, I would then counter that I have created a splitter range that beats  
its performance, by a lot.  As far as I can tell, I'm not doing anything  
special.

All I feel that I'm doing differently is instead of using find or indexOf,  
I'm looking at each char to see if it matches the first in the separator,  
and if it does, then I'm comparing the remaining characters.  Pretty  
braindead, probably room for improvement.

Splitter should beat this, or match it at least.  From testing the sample  
code in this thread, my simple version beats splitter by 40%.  Something  
isn't right somewhere, the difference should not be that drastic.

-Steve


More information about the Digitalmars-d mailing list