3 ms·
Could be even simpler than that. I want to know how it was compiled. I have a 2.3 GHz Intel Core i5 MacBook Pro, which is slower than the given hardware. The l
by eesmith 6y ago
Could be even simpler than that. I want to know how it was compiled.
I have a 2.3 GHz Intel Core i5 MacBook Pro, which is slower than the given hardware. The linked-to page reports "0.05s user".
I can reproduce that using g++ 9.1.0 using the default optimizations:
% g++-9 sieve.cc
% time ./a.out 4194304
0.056u 0.003s 0:00.06 83.3% 0+0k 0+0io 99pf+0w
If I recompile with -O3, the result is significantly faster:
% g++-9 -O3 sieve.cc
% time ./a.out 4194304
0.001u 0.003s 0:00.00 0.0% 0+0k 0+0io 98pf+0w