W
Wojciech Waga
I was trying to test some performance gains of move semantics when I
came across a strange thing, namely:
For a code:
http://pastebin.com/3jqgyc8v
(There is a copy constructor to prevent gcc4.6 from using default move
constructor which speeds up things greatly, but is of no interest here.)
The speed of resulting binary differs vastly among versions of gcc. It
seems like gcc<4.5 gives pretty good binary, and gcc>=4.5 does not.
Intel compiler 12.0.0 gives results similar to gcc<4.5.
For those who prefer bare values:
The same code compiled with:
gcc4.4.6 runs 0.47s
gcc4.6.1 runs 1.73s
A full plot comparing 3 versions of gcc with std= c++98/c++0x is here:
http://www.wojek.net/ww/gcc_speed.png
Does anyone know what is wrong? Especially the difference between gcc4.6
with and without c++0x is interesting. Can be there any c++0x
optimisations in library routines for this code?
Best regards,
Wojciech Waga
came across a strange thing, namely:
For a code:
http://pastebin.com/3jqgyc8v
(There is a copy constructor to prevent gcc4.6 from using default move
constructor which speeds up things greatly, but is of no interest here.)
The speed of resulting binary differs vastly among versions of gcc. It
seems like gcc<4.5 gives pretty good binary, and gcc>=4.5 does not.
Intel compiler 12.0.0 gives results similar to gcc<4.5.
For those who prefer bare values:
The same code compiled with:
gcc4.4.6 runs 0.47s
gcc4.6.1 runs 1.73s
A full plot comparing 3 versions of gcc with std= c++98/c++0x is here:
http://www.wojek.net/ww/gcc_speed.png
Does anyone know what is wrong? Especially the difference between gcc4.6
with and without c++0x is interesting. Can be there any c++0x
optimisations in library routines for this code?
Best regards,
Wojciech Waga