August 25, 2013 Re: Performance penalty for using ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On 08/25/2013 11:45 PM, bearophile wrote:
> Timon Gehr:
>
>>> ... but again, that will be slow compared to the for loop or a foreach
>>> across an interval.
>>
>> Why would that be the case?
>
> In the real world, where we live, ...
This is uncalled for.
|
August 25, 2013 Re: Performance penalty for using ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | On 26/08/13 00:36, Timon Gehr wrote:
> This is uncalled for.
I'm sure you didn't mean it, but your original remark, "Why would that be the case?", came across as flip and dismissive about a serious practical problem of working with D, that anyone caring about performance has run into.
I don't mean to defend or attack anyone, but I'm not surprised you got a sarcastic response.
|
August 25, 2013 Re: Performance penalty for using ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joseph Rushton Wakeling | On 08/26/2013 12:46 AM, Joseph Rushton Wakeling wrote:
> On 26/08/13 00:36, Timon Gehr wrote:
>> This is uncalled for.
>
> I'm sure you didn't mean it, but your original remark, "Why would that
> be the case?", came across as flip and dismissive about a serious
> practical problem
It was a genuine question. I assumed that the inliner actually works. But you are right, DMD does not even seem to inline iota, and gdc appears to fail to vectorize some iota-loops even though it vectorizes the range-foreach equivalent.
|
August 25, 2013 Re: Performance penalty for using ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | Timon Gehr:
> This is uncalled for.
I didn't mean to offend, sorry for the unneeded (light) sarcasm. While generally you seem expert in computer science and many other things, in several of your post you seem to dismiss a little too much practical considerations.
Bye,
bearophile
|
August 25, 2013 Re: Performance penalty for using ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On 08/26/2013 01:18 AM, bearophile wrote: > Timon Gehr: > >> This is uncalled for. > > I didn't mean to offend, No offence taken. > sorry for the unneeded (light) sarcasm. Well, this kind of thing does not propagate too well over the Internet. |
August 26, 2013 Re: Performance penalty for using ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Sunday, 25 August 2013 at 21:17:43 UTC, Andrei Alexandrescu wrote:
> On 8/25/13 12:46 PM, Joseph Rushton Wakeling wrote:
>> On 25/08/13 21:10, monarch_dodra wrote:
>>> It never clashes untill you nest two foreach, and then you have to use
>>> __ ...
>>>
>>> foreach( _ ; 0 .. M)
>>> foreach( __ ; 0 .. N)
>>> ...
>>>
>>> I have an enhancement request to simply allow anonymous iteration:
>>> foreach( ; 0 .. N)
>>>
>>> http://d.puremagic.com/issues/show_bug.cgi?id=9009
>>
>> Good call. :-)
>
> I don't see why the excitement around anonymous bindings. It's a rare case and it's not like we're running out of symbols, particularly given they're by definition written only once :o).
>
> Andrei
I think "the excitement" is an overstatement. The subject comes up every now and then. The "foreach(_)" semantic is getting a bit more common, but it tends to confuse newbies, that ask about it. At that point, I simply point out that there is this ER, and people tend to agree it would be a nice addition.
I agree it's not like its a real problem or anything, but it would be nice to have. Is all.
|
Copyright © 1999-2021 by the D Language Foundation