You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ clang++ -O3 -funroll-loops -std=c++20 -ffast-math a.cpp
$ time ./a.out5.00015e+13 100000000./a.out 3.37s user 0.47s system 98% cpu 3.882 total
$ lpython --fast a.py
$ time ./a.out50001499500000.00000000000000000 100000001./a.out 0.41s user 0.25s system 96% cpu 0.684 total
The text was updated successfully, but these errors were encountered:
Intel® Core™ i5-8250U CPU @ 1.60GHz × 8 (Ubuntu 22)
$ clang++ -std=c++20 -O3 -funroll-loops -march=native -ffast-math a.cpp
$ time ./a.out5.00015e+13 100000000./a.out 5.52s user 2.00s system 99% cpu 7.527 total
$ lpython --fast a.py
$ time ./a.out50001499500000.00000000000000000 100000001./a.out 1.97s user 1.30s system 99% cpu 3.270 total
% clang++ -O3 -funroll-loops -std=c++20 -ffast-math a.cpp -o a.out
% time ./a.out
5.00015e+13 100000000./a.out 5.26s user 1.56s system 90% cpu 7.498 total
% lpython --fast expr.py
% time ./a.out
50001499500000.00000000000000000 100000001
./a.out 0.97s user 0.81s system 88% cpu 2.016 total
See here: https://gist.github.com/czgdp1807/e7f7b6ca52c57b16b27ec8d0259c6d4a
There are multiple C++ versions, on my computer this one seems to be the fastest:
And here is a straightforward LPython version:
This gives me:
The text was updated successfully, but these errors were encountered: