Phoronix: GCC 6.2 Is Coming Quite Soon
Version 6.2 of the GNU Compiler Collection (GCC) is expected to come quite soon...
Version 6.2 of the GNU Compiler Collection (GCC) is expected to come quite soon...
$ cat a.cc #include <iostream> int main(int argc, char **argv) { std::cout << argc << std::endl; return 0; }
Compilation time: | $CXX -c a.cc -O0 | $CXX -c a.cc -O2 | $CXX -E a.cc | wc -c |
g++ 4.9.3 | 88 ms | 91 ms | 452 KiB |
g++ 6.1.0 | 180 ms | 185 ms | 670 KiB |
clang++ 4.0git | 39 ms | 42 ms | 458 KiB |
#include <iostream> #include <chrono> using namespace std; static unsigned long long fib(int n) { if (n < 2) return n; return fib(n - 1) + fib(n - 2); } int main() { chrono::high_resolution_clock::time_point t0 = chrono::high_resolution_clock::now(); cout << fib(47) << endl; cout << chrono::duration_cast<chrono::duration<double>>(chrono::high_resolution_clock::now() - t0).count() << std::endl; return 0; }
Comment