April 19, 2013
Why more linear algorithms implemented as O(N^2)?
example: staticMap, or staticIndex,  Erase, EraseAll, and etc..
see hello.d file.


April 19, 2013
Hi Khurshid,

On Fri, Apr 19, 2013 at 1:22 PM, Khurshid Normuradov <khurshid.normuradov@gmail.com> wrote:
> Why more linear algorithms implemented as O(N^2)?
> example: staticMap, or staticIndex,  Erase, EraseAll, and etc..
> see hello.d file.

Well, the algorithms are simply implemented in the most straightforward way, which is head/tail resp. car/cdr style. Many people (myself included) tend to switch their brains to functional programming mode when doing template metaprogramming, and slicing isn't included in that scheme.

Your approach to reducing the number of "total template arguments"
from O(n²) to O(n log(n)) is interesting, and indeed seems to lead to
speedups for operations on large tuples. Could you maybe put together
some performance numbers and post a pull request for further review?

David
_______________________________________________
phobos mailing list
phobos@puremagic.com
http://lists.puremagic.com/mailman/listinfo/phobos