This is a follow-up to this question where I posted this program:
#include
#include
#include
#include
That is not the results I get:
> g++ -O3 XX.cpp
> ./a.out
cast: 5 ms
memcpy: 4 ms
std::copy: 3 ms
(counter: 1264720400)
Hardware: 2GHz Intel Core i7
Memory: 8G 1333 MHz DDR3
OS: Max OS X 10.7.5
Compiler: i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1
On a Linux box I get different results:
> g++ -std=c++0x -O3 XX.cpp
> ./a.out
cast: 3 ms
memcpy: 4 ms
std::copy: 21 ms
(counter: 731359744)
Hardware: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
Memory: 61363780 kB
OS: Linux ip-10-58-154-83 3.2.0-29-virtual #46-Ubuntu SMP
Compiler: g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3