Array!T and find are slow

monarch_dodra via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 14 10:57:28 PDT 2014


On Wednesday, 14 May 2014 at 14:24:28 UTC, Damian Day wrote:
> I've found bench-marking my program that std.algorithm.find is
> very slow on Array!T, due to the fact it iterates on a range
> instead of a plain array.
>
> I've written some search functions, which are many times 
> faster, is it
> worth making a pull request?
>
> http://dpaste.dzfl.pl/63b54aa27f35#

BTW, this is a more "general" issue: Given a generic algorithm 
"std.foo", how can I write my own (better optimized) 
"object.foo", and make sure *that* is called instead?

I initially filed the issue for "retro", while indeed mentioning 
that "find" was also open to the improvement:
https://issues.dlang.org/show_bug.cgi?id=12583

This spawned the thread:
http://forum.dlang.org/thread/op.xeuot6g2eav7ka@stevens-macbook-pro-2.local

Unfortunately, nothing came of it.


More information about the Digitalmars-d-learn mailing list