Perf: Reduce Fibonacci benchmark time

This commit is contained in:
Michael Schimmel
2026-02-19 17:12:37 +01:00
parent b8390a3431
commit 55502cbb69
2 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
;; Complex Data Structure Test
;; Benchmark: 50.2us
;; Benchmark: 49.4us
;; Output: {:input 10, :name "Fibonacci", :output 55}
(do
(def fib (fn [n]
+17
View File
@@ -0,0 +1,17 @@
;; Benchmark: 602.1us
;; Takeuchi Function Benchmark
;; Benchmark: ~150ms (Specialized) vs ~1.5s (Dynamic)
;; heavily recursive, benefits significantly from specialization of integer arithmetic
;; and direct function calls (skipping dynamic dispatch).
;; Output: 7
(do
(def tak (fn [x y z]
(if (<= x y)
y
(tak (tak (- x 1) y z)
(tak (- y 1) z x)
(tak (- z 1) x y)))))
(tak 10 6 3)
)