2 ms·
C++ Is NOT 9.4 Times Faster Than Python in Prime Number Test I added 3 lines to the Python code and got it 10x faster: (venv) $ python prime.py Numbe
by fdomingues 6y ago
C++ Is NOT 9.4 Times Faster Than Python in Prime Number Test
I added 3 lines to the Python code and got it 10x faster:
(venv) $ python prime.py
Number of primes between 0 to 1000000 = 78498
Elapsed time: 6.502481937408447
(venv) $ python prime.py
Number of primes between 0 to 1000000 = 78498
Elapsed time: 0.6258630752563477
Diff:
3c3,5
<
---
> import numba
>
> @numba.njit
14a17
> @numba.njit