chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Possible chicken performance tweak


From: Tony Sidaway
Subject: [Chicken-hackers] Possible chicken performance tweak
Date: Tue, 6 Mar 2007 19:56:22 +0000

I tweaked my copy of chicken.scm to read each input file into a string
and then compile from the string.  The time saved seems to be of the
order 10% on my laptop system, when tested on the 2100-line
posixunix.scm.

        (let* ((f (car files))
                 (fs (with-input-from-file f read-string)) ; NEW: read into 
string
                 ;;;(in (check-and-open-input-file f))
                (in (open-input-string fs)) ; NEW: open string file
                (x1 (read-form in)) )
                 (do ((x x1 (read-form in)))
                      ((eof-object? x)
                       ;;;(close-checked-input-file in f)
                       #t ; NEW: placeholder in the (do) form.
                       )
                    (set! forms (cons x forms)) ) )

Trace information, containing filename and line number, is unaffected.
The change seems to be transparent.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]