Skip to content

Commit

Permalink
Big performance improvement for compiled libraries by allowing cross …
Browse files Browse the repository at this point in the history
…assembly method references.

Compiled libraries are now loaded from disk, and not memory anymore.
Add optimizer pass to eliminate tail calls if the callee can be proven to be non-recursive.
Udpate bootfile.

git-tfs-id: [https://tfs.codeplex.com:443/tfs/TFS02]$/IronScheme;C115179
  • Loading branch information
leppie committed Sep 30, 2015
1 parent 420cb13 commit e774417
Show file tree
Hide file tree
Showing 16 changed files with 9,464 additions and 9,315 deletions.
Binary file modified IronScheme/IronScheme.Console/ironscheme.boot.dll
Binary file not shown.
685 changes: 344 additions & 341 deletions IronScheme/IronScheme.Console/lib/ironscheme/typed/fixnums.sls

Large diffs are not rendered by default.

92 changes: 46 additions & 46 deletions IronScheme/IronScheme.Console/playground/foo2.sls
@@ -1,46 +1,46 @@
(library (foo2)
(export run)
(import
(except (ironscheme) define + - < = time fx+ fx- fx<? fx=?)
(ironscheme typed)
(ironscheme syntax)
(only (ironscheme datetime) measure)
(rename (only (ironscheme typed fixnums) fx+ fx- fx<? fx=?)
(fx+ +)
(fx- -)
(fx<? <)
(fx=? =)))

(define-syntax-case (define (name arg ...) body ...)
#'(define: (name (arg : fixnum) ... -> fixnum)
body ...))

(define-syntax-rule (time expr)
(measure 100 expr))

(define (ack m n)
(cond
[(= m 0) (+ n 1)]
[(= n 0) (ack (- m 1) 1)]
[else (ack (- m 1) (ack m (- n 1)))]))

(define (fib n)
(if (< n 2)
n
(+ (fib (- n 1)) (fib (- n 2)))))

(define (tak x y z)
(if (not (< y x))
z
(tak (tak (- x 1) y z)
(tak (- y 1) z x)
(tak (- z 1) x y))))

(define (run)
(ack 3 1)
(time (ack 3 9))
(fib 10)
(time (fib 33))
(tak 18 12 6)
(time (tak 21 16 6))
0))
(library (foo2)
(export run)
(import
(except (ironscheme) define + - < = time fx+ fx- fx<? fx=?)
(ironscheme typed core)
(ironscheme syntax shorthand)
(only (ironscheme datetime) measure)
(rename (only (ironscheme typed fixnums) fx+ fx- fx<? fx=?)
(fx+ +)
(fx- -)
(fx<? <)
(fx=? =)))

(define-syntax-rule (define (name arg ...) body ...)
#'(define: (name (arg : fixnum) ... -> fixnum)
body ...))

(define-syntax-rule (time expr)
(measure 100 expr))

(define (ack m n)
(cond
[(= m 0) (+ n 1)]
[(= n 0) (ack (- m 1) 1)]
[else (ack (- m 1) (ack m (- n 1)))]))

(define (fib n)
(if (< n 2)
n
(+ (fib (- n 1)) (fib (- n 2)))))

(define (tak x y z)
(if (not (< y x))
z
(tak (tak (- x 1) y z)
(tak (- y 1) z x)
(tak (- z 1) x y))))

(define (run)
(ack 3 1)
(time (ack 3 9))
(fib 10)
(time (fib 33))
(tak 18 12 6)
(time (tak 21 16 6))
0))

0 comments on commit e774417

Please sign in to comment.