-
Notifications
You must be signed in to change notification settings - Fork 0
Benchmarks
Ahmet Burak Biçer edited this page Jun 30, 2026
·
1 revision
Both methods are deterministic. The gap is engineering (wheel + Numba + threads), not weaker math on the 64-bit path.
| Method | Description |
|---|---|
| Primitive | Pure Python: odds only up to isqrt(n)
|
| Optimized |
is_prime() — 30030-wheel + Numba (+ threads) |
NUMBA_NUM_THREADS=$(nproc) python benchmarks/compare_speed.py
NUMBA_NUM_THREADS=$(nproc) python benchmarks/compare_speed.py --include-hard| Case | Speedup (optimized vs primitive) |
|---|---|
|
|
~20× |
| Mersenne |
~17× |
| 12-digit prime | ~90–100× |
| Near |
Optimized ~0.7s; primitive usually skipped (too slow) |
Details: benchmarks/README.md
Best-Prime-Number-Function — deterministic primality (no stochastic MR) · Source · Wiki maintained from docs/wiki/ + this GitHub Wiki
Wiki
- Home
- Project restrictions
- Algorithm overview
- CI and automation
- Agent briefing
- Contributing
- Benchmarks
- Hall of fame
AI-designed project — review before production use.