Skip to content

Commit

Permalink
Tweek gc countdown variable
Browse files Browse the repository at this point in the history
This pushes performance of recursion04 quite a bit, at fib 30:
from 3.25s down to 1.12s.
  • Loading branch information
rootmos committed Jul 23, 2017
1 parent 8234fb9 commit 920c5d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/recursion04.expected
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
13
21
196418
832040
2 changes: 1 addition & 1 deletion examples/recursion04.silly-ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ let rec fib n = match n with

print_int (fib 7); print_newline ();;
print_int (fib 8); print_newline ();;
print_int (fib 27); print_newline ();;
print_int (fib 30); print_newline ();;
2 changes: 1 addition & 1 deletion src/backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ let gc = {
mov (label gc_countdown_label) (reg rax) >>
test (reg rax) (reg rax) >>
jnz (label "__gc_done") >>
mov (const 20) (label gc_countdown_label) >>
mov (const 1000) (label gc_countdown_label) >>

define (reg rdi) >>= fun arg ->
define (reg rsi) >>= fun closure ->
Expand Down

0 comments on commit 920c5d4

Please sign in to comment.