Skip to content

Commit

Permalink
Made recfib benchmark faster
Browse files Browse the repository at this point in the history
  • Loading branch information
Melchizedek6809 committed Apr 25, 2024
1 parent 2976d69 commit 26d191a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion benchmark/recfib/fib.nuj
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
((= 1 n) 1)
(#t (+ (fib (- n 1)) (fib (- n 2))))))

(pfmtln "fib(40) is: {}\nGC Runs: {}" (fib 40) (garbage-collection-runs))
(pfmtln "fib(30) is: {}\nGC Runs: {}" (fib 30) (garbage-collection-runs))
4 changes: 2 additions & 2 deletions benchmark/recfib/fib.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
((= 1 n) 1)
(#t (+ (fib (- n 1)) (fib (- n 2))))))

(display "fib(40) = ")
(display (fib 40))
(display "fib(30) = ")
(display (fib 30))
(display "\n")
2 changes: 2 additions & 0 deletions nujel-benchmark.tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Command terminated by signal 2
#@(:user 6.22 :system 0.00 :elapsed "0:06.32" :cpu "98%" :text 0 :data 0 :max-resident 19380 :inputs 0 :outputs 0 :pagefaults-major 0 :pagefaults-minor 3909 :swaps 0)
2 changes: 1 addition & 1 deletion tools/benchmark.nuj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
("crc32" "0936343A")
("compile-stdlib" "Image built")
("adler32" "E50BA232")
("recfib" "102334155")
("recfib" "832040")
(otherwise "チーズスイートホーム")))

(def time-template "#@(:user %U :system %S :elapsed \\\"%E\\\" :cpu \\\"%P\\\" :text %X :data %D :max-resident %M :inputs %I :outputs %O :pagefaults-major %F :pagefaults-minor %R :swaps %W)")
Expand Down

0 comments on commit 26d191a

Please sign in to comment.