Skip to content

Commit 6817189

Browse files
Docs: Implement benchmark.
1 parent e083c05 commit 6817189

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

compiler/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,26 @@ echo 'export PATH="/path/to/compiler:$PATH"' >> ~/.bashrc
3131
source ~/.bashrc
3232
```
3333

34+
### Benchmark
35+
36+
Recursive Fibonacci — `fib(30)` (~2.7M calls):
37+
38+
```python
39+
def fib(n):
40+
41+
if n < 2: return n
42+
43+
return fib(n-1) + fib(n-2)
44+
45+
print(fib(30))
46+
```
47+
48+
| Runtime | real | user | sys |
49+
|--------------|----------|----------|----------|
50+
| CPython 3.13 | 0m0.103s | 0m0.083s | 0m0.012s |
51+
| Edge Python | 0m0.015s | 0m0.003s | 0m0.000s |
52+
53+
*6.8x faster than CPython on pure recursive call overhead.*
3454

3555
### Usage
3656

0 commit comments

Comments
 (0)