Skip to content

Commit

Permalink
add benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Timfon committed Dec 2, 2024
1 parent 533cac2 commit 74619e2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions benchmarks/constant-inlining.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(define (g y)
(- y (+ y (- y (+ 5 (+ y (+ y (- y y))))))))

(print
(let ((y 8))
(g (g y))))
7 changes: 7 additions & 0 deletions benchmarks/constant-prop.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(let ((a 7))
(let ((b 12))
(let ((c 9))
(print (+ a (- b (+ c (- 8 (+ b (- a (- c (+ b (- a (+ c 15))))))))))
)
)
))
8 changes: 8 additions & 0 deletions benchmarks/inlining.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(define (f1 x) (+ x 5))
(define (f2 x) (* (f1 x) 2))
(define (f3 x) (- (f2 x) (f1 x)))
(define (f4 x) (/ (f3 x) 3))

(print
(let ((x 10))
(f4 (f3 (f2 (f1 x))))))

0 comments on commit 74619e2

Please sign in to comment.