Yet another strike against the current AA implementation
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon Apr 27 05:03:38 PDT 2009
dsimcha wrote:
> Output:
> Direct: 2343
> Virtual: 5695
> opApply: 3014
>
> Bottom line is that these pretty much come in the order you would expect them to,
> but there are no particularly drastic differences between any of them. To put
> these timings in perspective, 5700 ms for 1 billion iterations is roughly (on a
> 2.7 GHz machine) 15 clock cycles per iteration. How often does anyone really have
> code that is performance critical *and* where the contents of the loop don't take
> long enough to dwarf the 15 clock cycles per iteration loop overhead *and* you
> need the iteration to be polymorphic?
Thanks for the numbers. The way I'd read them is not to look at the
milliseconds but at the fractions. Loops with opApply have an extra 28%
overhead, and I think that doesn't make them look very well.
Bearophile's numbers show a 30% overhead.
I have measurements that show more dramatic pessimization, but I never
keep those around. I know in my early tests for std.algorithm that had I
used opApply in it, I would have essentially never used an algorithm if
I could help it.
Andrei
More information about the Digitalmars-d
mailing list