Benchmarks
Benchmarked against equivalent C++ (g++ -O2) and Python 3.14. Best of 3 runs.
Visuall matches or beats C++ on 6 of 10 macro benchmarks. Compute-bound integer and loop work is within 1.0–1.4× of C++. Recursion-heavy workloads (Ackermann, TreeSum) are 4–9× due to GC stack scanning overhead.
Macro Benchmarks
| Test | C++ (ms) | Visuall (ms) | Python (ms) | V / C++ | Py / C++ |
|---|---|---|---|---|---|
| Primes (trial div, 100K ×3) | 23.2 | 31.7 | 415 | 1.4× | 18× |
| TreeSum (recursive, depth 22) | 15.2 | 63.8 | 1,298 | 4.2× | 85× |
| Collatz (1..100K) | 30.6 | 23.1 | 1,758 | 0.8× | 57× |
| Strings (200K f-strings) | 27.9 | 47.9 | 162 | 1.7× | 6× |
| Pi (Leibniz, 10M terms) | 23.1 | 23.7 | 2,884 | 1.0× | 125× |
| Nested loops (2000×2000) | 11.0 | 10.7 | 705 | 1.0× | 64× |
| Ackermann (3,11) | 178.8 | 1,589.3 | 28,098 | 8.9× | 157× |
| GCD sum (1..2000) | 56.2 | 61.9 | 724 | 1.1× | 13× |
| Fibonacci (fib(35) ×500K) | 9.2 | 9.7 | 684 | 1.0× | 74× |
| Float distance (1M) | 10.4 | 10.1 | 403 | 1.0× | 39× |
Micro Benchmarks
| Test | Iterations | C++ | Visuall | vs C++ | Python |
|---|---|---|---|---|---|
| Match dispatch | 1M | 11.9 ms | 9.2 ms | 0.8× | 222 ms |
| Function call | 1M | 8.5 ms | 12.6 ms | 1.5× | 251 ms |
| Tight loop sum | 100K | 7.1 ms | 7.7 ms | 1.1× | 47 ms |
Methodology
All tests run against equivalent C++ compiled with g++ -O2 and Python 3.14.
Best of 3 runs reported. Test machine: not documented; these are README benchmarks.
Benchmarks updated for Visuall v1.1.0.