Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Go vs. C++ – Which is faster?. Parent comment
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
% g++-9 -O3 sieve.cc % time ./a.out 4194304 0.001u 0.003s 0:00.00 0.0% 0+0k 0+0io 98pf+0w
There are no comments on this comment yet.
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:
If I recompile with -O3, the result is significantly faster: