Re: Performance of ranges verses direct

2013-12-14 Thread Nikolay
And now try -inline-threshold=1024 ;-) Reading -help-hidden sometimes helps. Thanks. It is really game changer. I get my words about ranges back.

Re: Performance of ranges verses direct

2013-12-13 Thread lomereiter
On Friday, 13 December 2013 at 18:03:28 UTC, Nikolay wrote: Results: ~/ldc2-0.12.0-linux-x86_64/bin/ldmd2 -O -release -inline zip_test.d ./zip_test --limit 1000 … 0 - 0 1 - 764 And now try -inline-threshold=1024 ;-) Reading -help-hidden sometimes helps.

Re: Performance of ranges verses direct

2013-12-13 Thread Nikolay
I found that performance of ranges is miserable in many cases. You should not use them if there is any chance for big/critical computations. Actually I don't like to have two subsets of language: one with good performance, and other with good maintainability/readability. I have a couple thought

Re: Performance of ranges verses direct

2013-12-13 Thread Marco Leise
Am Thu, 12 Dec 2013 16:02:28 +0100 schrieb "John Colvin" : > On Wednesday, 11 December 2013 at 16:40:48 UTC, Joseph Rushton > Wakeling wrote: > > [* If I recall right, it's achievable by special-casing iota > > when the increment is 1, but don't quote me on that.] > > That shouldn't be necessar

Re: Performance of ranges verses direct

2013-12-12 Thread John Colvin
On Wednesday, 11 December 2013 at 16:40:48 UTC, Joseph Rushton Wakeling wrote: [* If I recall right, it's achievable by special-casing iota when the increment is 1, but don't quote me on that.] That shouldn't be necessary if the iota operations are inlined (which, if their not, is a much great

Re: Performance of ranges verses direct

2013-12-12 Thread Marco Leise
Am Wed, 11 Dec 2013 17:40:39 +0100 schrieb Joseph Rushton Wakeling : > On 11/12/13 11:10, John Colvin wrote: > > A lot of the performance loss is down to missed optimisations, in particular > > inlining. > > Simple example: > > foreach(i; iota(0, 10)) { ... } > > should be as fast as > >

Re: Performance of ranges verses direct

2013-12-11 Thread Joseph Rushton Wakeling
On 11/12/13 11:10, John Colvin wrote: A lot of the performance loss is down to missed optimisations, in particular inlining. Simple example: foreach(i; iota(0, 10)) { ... } should be as fast as foreach(i; 0 .. 10) { ... } but isn't. I remember Andrei noting that this ought to be ea

Re: Performance of ranges verses direct

2013-12-11 Thread John Colvin
On Wednesday, 11 December 2013 at 07:29:39 UTC, Frustrated wrote: Has anyone done any work on comparing the performance of ranges vs using direct straightforward code(optimized in the sense of the way ranges work but by hand). e.g., How does filter compare to a simple loop over the elements

Re: Performance of ranges verses direct

2013-12-11 Thread Marco Leise
Am Wed, 11 Dec 2013 08:29:38 +0100 schrieb "Frustrated" : > > Has anyone done any work on comparing the performance of ranges > vs using direct straightforward code(optimized in the sense of > the way ranges work but by hand). > > e.g., How does filter compare to a simple loop over the element

Performance of ranges verses direct

2013-12-10 Thread Frustrated
Has anyone done any work on comparing the performance of ranges vs using direct straightforward code(optimized in the sense of the way ranges work but by hand). e.g., How does filter compare to a simple loop over the elements and comparing it. How does a a chain of UFCS compare to doing the