Yet another strike against the current AA implementation

Christopher Wright dhasenan at gmail.com
Sun Apr 26 18:38:27 PDT 2009


Andrei Alexandrescu wrote:
> 2. I haven't measured, but the cost of the indirect call is large enough 
> to make me suspect that opApply is not as efficient as it's cracked to 
> be, even when compared with an iterator.

When you know the type beforehand or can use templates, that is, rather 
than wrapping your range struct in a wrapper class. If you can't use a 
template for whatever reason, ranges are going to suck -- three virtual 
calls rather than one.

I don't usually care sufficiently about performance to worry about 
whether a call is virtual or not, but you brought that issue up before. 
And I imagine that, most of the time, you will know the range type in 
advance.



More information about the Digitalmars-d mailing list