Performance of map!()

2015-04-24 Thread Chris via Digitalmars-d
I replaced a range that was similar to map with map and the performance dropped by ~0.5 msec. The range I used previously is based on Adam's D Cookbook. It is consistently faster than map. private struct Transformer(alias agent, R) if (isInputRange!R) { private R r; this (R r) { this

Re: Performance of map!()

2015-04-24 Thread John Colvin via Digitalmars-d
On Friday, 24 April 2015 at 10:22:05 UTC, Chris wrote: I replaced a range that was similar to map with map and the performance dropped by ~0.5 msec. The range I used previously is based on Adam's D Cookbook. It is consistently faster than map. private struct Transformer(alias agent, R) if (i

Re: Performance of map!()

2015-04-24 Thread Chris via Digitalmars-d
On Friday, 24 April 2015 at 10:53:04 UTC, John Colvin wrote: On Friday, 24 April 2015 at 10:22:05 UTC, Chris wrote: I replaced a range that was similar to map with map and the performance dropped by ~0.5 msec. The range I used previously is based on Adam's D Cookbook. It is consistently faste

Re: Performance of map!()

2015-04-24 Thread John Colvin via Digitalmars-d
On Friday, 24 April 2015 at 10:22:05 UTC, Chris wrote: I replaced a range that was similar to map with map and the performance dropped by ~0.5 msec. The range I used previously is based on Adam's D Cookbook. It is consistently faster than map. private struct Transformer(alias agent, R) if (i

Re: Performance of map!()

2015-04-24 Thread via Digitalmars-d
dmd v2.067.0 dub --build=release (-release -inline -O -boundscheck=off) Does a benchmark of dmd generated code really matter?

Re: Performance of map!()

2015-04-24 Thread Chris via Digitalmars-d
On Friday, 24 April 2015 at 11:33:48 UTC, John Colvin wrote: On Friday, 24 April 2015 at 10:22:05 UTC, Chris wrote: I replaced a range that was similar to map with map and the performance dropped by ~0.5 msec. The range I used previously is based on Adam's D Cookbook. It is consistently faste

Re: Performance of map!()

2015-04-24 Thread Chris via Digitalmars-d
On Friday, 24 April 2015 at 11:38:46 UTC, Casper Færgemand wrote: dmd v2.067.0 dub --build=release (-release -inline -O -boundscheck=off) Does a benchmark of dmd generated code really matter? At least for dmd.

Re: Performance of map!()

2015-04-24 Thread via Digitalmars-d
On Friday, 24 April 2015 at 11:49:24 UTC, Chris wrote: On Friday, 24 April 2015 at 11:38:46 UTC, Casper Færgemand wrote: dmd v2.067.0 dub --build=release (-release -inline -O -boundscheck=off) Does a benchmark of dmd generated code really matter? At least for dmd. dmd is good at making ma

Re: Performance of map!()

2015-04-24 Thread via Digitalmars-d
On Friday, 24 April 2015 at 11:33:48 UTC, John Colvin wrote: That is pretty much identical to the implementation of map, see https://github.com/D-Programming-Language/phobos/blob/master/std/algorithm/iteration.d#L504 The only difference is that you don't implement opSlice. Perhaps slicing is p