Add benchmark metadata to examples
This commit is contained in:
@@ -1,2 +1,4 @@
|
|||||||
|
;; Benchmark: 148ns
|
||||||
|
;; Benchmark-Repeat: 13466
|
||||||
;; Output: 5
|
;; Output: 5
|
||||||
(((fn [x] (fn [] x)) 5))
|
(((fn [x] (fn [] x)) 5))
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
;; Benchmark: 623ns
|
||||||
|
;; Benchmark-Repeat: 3201
|
||||||
;; Output: 5
|
;; Output: 5
|
||||||
(do
|
(do
|
||||||
(def f (fn [x] (fn [] x)))
|
(def f (fn [x] (fn [] x)))
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
;; Benchmark: 1.1us
|
||||||
|
;; Benchmark-Repeat: 1814
|
||||||
;; Output: 42
|
;; Output: 42
|
||||||
(do
|
(do
|
||||||
(def f (fn [a] (fn [b] (fn [c] (+ a (+ b c))))))
|
(def f (fn [a] (fn [b] (fn [c] (+ a (+ b c))))))
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
;; Benchmark: 374ns
|
||||||
|
;; Benchmark-Repeat: 5419
|
||||||
;; examples/def_local_inlining.myc
|
;; examples/def_local_inlining.myc
|
||||||
;; Demonstrates potential for DefLocal-Inlining (Phase 2.5)
|
;; Demonstrates potential for DefLocal-Inlining (Phase 2.5)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
;; Benchmark: 1.7us
|
;; Benchmark: 1.3us
|
||||||
;; Benchmark-Repeat: 1198
|
;; Benchmark-Repeat: 1494
|
||||||
;; Output: 36
|
;; Output: 36
|
||||||
(do
|
(do
|
||||||
;; Excessive capture test
|
;; Excessive capture test
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
|
;; Benchmark: 150ns
|
||||||
|
;; Benchmark-Repeat: 13074
|
||||||
;; Output: 30
|
;; Output: 30
|
||||||
(+ 10 20)
|
(+ 10 20)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
;; Benchmark: 462ns
|
;; Benchmark: 384ns
|
||||||
;; Benchmark-Repeat: 4348
|
;; Benchmark-Repeat: 5255
|
||||||
;; Financial DSL Macro example
|
;; Financial DSL Macro example
|
||||||
;; Demonstrates generating complex records from simple parameters.
|
;; Demonstrates generating complex records from simple parameters.
|
||||||
;; Output: {:price 100, :size 2, :total 200}
|
;; Output: {:price 100, :size 2, :total 200}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
;; Benchmark: 376ns
|
;; Benchmark: 223ns
|
||||||
;; Benchmark-Repeat: 5359
|
;; Benchmark-Repeat: 8929
|
||||||
;; Nested Macro and Arithmetic example
|
;; Nested Macro and Arithmetic example
|
||||||
;; Output: 81
|
;; Output: 81
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
;; Benchmark: 501ns
|
||||||
|
;; Benchmark-Repeat: 4038
|
||||||
(do
|
(do
|
||||||
(def PI 3.1415)
|
(def PI 3.1415)
|
||||||
(def area (fn [x] (* PI x)))
|
(def area (fn [x] (* PI x)))
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
;; Benchmark: 666ns
|
||||||
|
;; Benchmark-Repeat: 2975
|
||||||
|
(do
|
||||||
|
;; 1. Provokation Stack-Gap (bei Optimization Level 2)
|
||||||
|
(def result
|
||||||
|
(fn []
|
||||||
|
(do
|
||||||
|
(def unused 10) ;; Wird entfernt, Slot 0 ist dann "leer"
|
||||||
|
(def used 42) ;; Bleibt auf Slot 1 -> Lücke!
|
||||||
|
used)))
|
||||||
|
|
||||||
|
;; 2. Provokation Inlining-Blockade
|
||||||
|
;; Diese Funktion wird nicht inlined, weil sie ein 'def' enthält
|
||||||
|
(def complex-add
|
||||||
|
(fn [a]
|
||||||
|
(do
|
||||||
|
(def b 100)
|
||||||
|
(+ a b))))
|
||||||
|
|
||||||
|
[(result) (complex-add 50)]
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user