
On 05/07/2010 07:57 AM, Marius Stoica wrote:
On Friday 07 May 2010 16:06:41 DE wrote:
on 06.05.2010 at 22:48
Kenny Riddile wrote :
If you mean a language-imposed, inherent abstraction penalty, then I doubt it (certainly not 33%). You can find out for yourself though:
http://www.stepanovpapers.com/AbstractionPenaltyBenchmark.cpp
i've run the code for my everyday compiler (msvc80) and it greported no abstraction penalty
i've also tried icc11 and it showed minor abstraction penalty (mean = 1.17)
i'm trying gcc 4.4.3 here
(optimization/total/penalty )
O0/ 32.15 /5.29 O1/ 1.02 /0.39 O2/ 0.86 /0.94 O3/ 1.09 /0.39 Os/ 0.96 /0.44
Do i understand that rigth or does gcc produce better code when you abstract away ?
[Continuing the slightly OT discussion...] I noticed this, too, just with the default release settings on MSVC9. I can only think to attribute this to iterating through indices in the C-style version, rather than through iterators...? I haven't looked closely at it at all, though. - Jeff