Update benchmark timings and repeats

This commit updates the benchmark timings and repeat counts for various
example files. The `tester.rs` script has been modified to:

- Correctly parse and use the `Benchmark-Repeat` directive.
- Implement an adaptive sampling mechanism for more accurate median
  calculation, especially for long-running benchmarks.
- Improve the logic for updating and inserting benchmark and repeat
  lines in example files.
- Handle potential compilation and runtime errors during benchmark
  execution.
This commit is contained in:
Michael Schimmel
2026-02-20 17:11:13 +01:00
parent 87259584ee
commit 9072cfaa14
16 changed files with 195 additions and 103 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
;; Closure Scope Test
;; Benchmark: 800ns
;; Benchmark: 780ns
;; Benchmark-Repeat: 2602
;; Output: 15
(do
(def make-adder (fn [x]
+2 -1
View File
@@ -1,5 +1,6 @@
;; Complex Data Structure Test
;; Benchmark: 51.4us
;; Benchmark: 52.9us
;; Benchmark-Repeat: 39
;; Output: {:name "Fibonacci", :input 10, :output 55}
(do
(def fib (fn [n]
+2
View File
@@ -1,3 +1,5 @@
;; Benchmark: 2.6us
;; Benchmark-Repeat: 788
;; Comprehensive Destructuring Test
;; Covers: Nested tuples, mixed params, dynamic passing
+2 -1
View File
@@ -1,4 +1,5 @@
;; Benchmark: 1.6us
;; Benchmark: 1.8us
;; Benchmark-Repeat: 1103
;; Output: 36
(do
;; Excessive capture test
+2 -1
View File
@@ -1,5 +1,6 @@
;; Fibonacci Recursive
;; Benchmark: 49.7us
;; Benchmark: 52.7us
;; Benchmark-Repeat: 38
;; Output: 55
(do
(def fib (fn [n]
+2 -1
View File
@@ -1,5 +1,6 @@
;; Higher-Order Function Example
;; Benchmark: 600ns
;; Benchmark: 725ns
;; Benchmark-Repeat: 2768
;; Output: 25
(do
(def apply (fn [f x] (f x)))
+2 -1
View File
@@ -1,4 +1,5 @@
;; Benchmark: 400ns
;; Benchmark: 484ns
;; Benchmark-Repeat: 4144
;; Financial DSL Macro example
;; Demonstrates generating complex records from simple parameters.
;; Output: {:price 100, :size 2, :total 200}
+2 -1
View File
@@ -1,4 +1,5 @@
;; Benchmark: 400ns
;; Benchmark: 448ns
;; Benchmark-Repeat: 4488
;; Output: 5
(do
(def y 1)
+2 -1
View File
@@ -1,4 +1,5 @@
;; Benchmark: 300ns
;; Benchmark: 429ns
;; Benchmark-Repeat: 4712
;; Nested Macro and Arithmetic example
;; Output: 81
+2 -1
View File
@@ -1,4 +1,5 @@
;; Benchmark: 300ns
;; Benchmark: 320ns
;; Benchmark-Repeat: 6238
;; Macro Splicing example
;; Demonstrates unrolling a list into another list.
;; Output: [0 1 2 3 4]
+2 -1
View File
@@ -1,4 +1,5 @@
;; Benchmark: 200ns
;; Benchmark: 209ns
;; Benchmark-Repeat: 9540
;; Classic "unless" macro example
;; Demonstrates simple template substitution.
;; Output: 42
+2 -1
View File
@@ -1,6 +1,7 @@
;; Record to Tuple Mapping Test
;; Output: 30
;; Benchmark: 700ns
;; Benchmark: 755ns
;; Benchmark-Repeat: 2652
(do
(def rec {:x 10 :y 20})
+2 -1
View File
@@ -2,7 +2,8 @@
;; This test calls a function that destructures a record 100.000 times.
;; Current implementation is now zero-allocation for destructuring.
;; Output: {:a 1, :b 2}
;; Benchmark: 5.3ms
;; Benchmark: 5.2ms
(do
(def process (fn [[x y]]
(+ x y)))
+2 -1
View File
@@ -2,7 +2,8 @@
;; heavily recursive, benefits significantly from specialization of integer arithmetic
;; and direct function calls (skipping dynamic dispatch).
;; Output: 5
;; Benchmark: 461.4us
;; Benchmark-Repeat: 6
(do
+2 -1
View File
@@ -1,4 +1,5 @@
;; Benchmark: 1.9us
;; Benchmark: 1.7us
;; Benchmark-Repeat: 1196
;; Demonstration of N-dimensional Tuples, Vectors, and Matrices
;; Based on docs/Tupel 1.md
;;