Perf: Reduce Fibonacci benchmark time
This commit is contained in:
+1
-1
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
Reference in New Issue
Block a user