Skip to content

Commit b067e36

Browse files
committed
fixup: add python and tar bench
1 parent fd35825 commit b067e36

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/codspeed.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
- bench/testdata/take_strings-aarch64
1818
- ls -alh /etc
1919
- echo Hello, World!
20-
- tar czf /tmp/man.tar.gz /usr/share/man
20+
- tar czf /tmp/news.tar.gz NEWS NEWS.old NEWS.older
21+
- python3 bench/fib.py
2122
valgrind:
2223
- "3.26.0"
2324
- "3.25.1"

bench/fib.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python3
2+
"""Simple recursive Fibonacci benchmark."""
3+
4+
5+
def fib(n):
6+
"""Calculate Fibonacci number recursively."""
7+
if n <= 1:
8+
return n
9+
return fib(n - 1) + fib(n - 2)
10+
11+
12+
if __name__ == "__main__":
13+
result = fib(35)
14+
print(f"fib(35) = {result}")

0 commit comments

Comments
 (0)