
14 May
2008
14 May
'08
9:23 p.m.
The result has been noticed before. In fact I wrote about it in several posts on c.l.c++.m, and in N2486 in the first few pages it uses this effect to illustrate a point about allocators. Nevertheless, the result is still surprising!! What is worse is that different compilers and libraries will give you way different results for this test, so it is not just a function of Intel. ( I have not tried to reproduce the results on anything but intel).
Changing from using a std::vector<int> with a single space allocation (not push_back) to a int[] improved the speed but not scalability... James