|
From: | Przemysław Soboń |
Subject: | [MIT-Scheme-devel] MIT-Scheme 9.0.1 performance problem. |
Date: | Fri, 13 May 2011 10:31:31 +0200 |
I work with MIT Scheme 7.5.17 in Linux and recently had to update to
64-bit version 9.0.1. Unfortunately I noticed that performance drops
while adding new definitions. For example I have a loop like the one
below:
-----------------------------------
(with-timings
(lambda ()
(let ((ls '()))
(display "aaa\n")
(do ((i 0 (+ i 1))) ((> i 2000000)) (set! ls (append (list i) ls)))
))
(lambda (rt gt pt)
(format #t "~a ~a ~a\n" (internal-time/ticks->seconds rt)
(internal-time/ticks->seconds gt) (internal-time/ticks->seconds
pt))))
------------------------------------
The time executed is equal to:
2. .64 2.641
If I add a few defines like in to code below I get the results like
"2.09 .62 2.717" The results are very constant in the first and the
next case even if I repeat the measurements many times using fresh
Scheme instance.
------------------------------------
(define (skiplist? obj)
(rb-tree? obj))
(define (make-skiplist key=? key<?)
(make-rb-tree key=? key<?))
(define (skiplist/insert! skiplist key datum)
(rb-tree/insert! skiplist key datum))
(define (skiplist/delete! skiplist key datum)
(rb-tree/delete! skiplist key datum))
(define (skiplist/lookup skiplist key default)
(rb-tree/lookup skiplist key default))
(define (skiplist/size skiplist)
(rb-tree/size skiplist))
(define (skiplist/min skiplist default)
(rb-tree/min skiplist default))
(define (skiplist/min-datum skiplist default)
(rb-tree/min-datum skiplist default))
(define (skiplist/delete-min-datum! skiplist default)
(rb-tree/delete-min-datum! skiplist default))
(define (skiplist/delete-min! skiplist default)
(rb-tree/delete-min! skiplist default))
(define (skiplist/for-each-datum skiplist proc)
(for-each proc (rb-tree/datum-list skiplist)))
(with-timings
(lambda ()
(let ((ls '()))
(display "aaa\n")
(do ((i 0 (+ i 1))) ((> i 2000000)) (set! ls (append (list i) ls)))
))
(lambda (rt gt pt)
(format #t "~a ~a ~a\n" (internal-time/ticks->seconds rt)
(internal-time/ticks->seconds gt) (internal-time/ticks->seconds
pt))))
------------------------------------
My program contains a few thousands of definitions so if I load them
and run my loop afterwards it is executed in e.g. 80 seconds instead
of 2. The problem does not occur in the previous version of Scheme I
was using (7.5.17). Regardless number of definitions the execution
time of the loop is equal to ~1.7s
I've even tried to install Scheme 9.0.1 on Windows from the binaries
thinking I did something wrong while compiling or with my Linux. The
performance drop after adding a few definitions is present there as
well.
Do you have any ideas how to make the Scheme working as previously? It
might be I do something wrong.
Thanks in advance,
Przemek
[Prev in Thread] | Current Thread | [Next in Thread] |