"Larry D'Anna" <larry@...> writes:
> I've added an implementation of augment-environment to my patch, as
> well as a bug fix to variable-information. Also attached is a test
> file for these things.
Thanks. But it would be better if the tests were integrated along with
the existing sb-cltl2 tests, in contrib/sb-cltl2/tests.lisp.
--
Juho Snellman

Hi,
My program uses files with many #= abbreviations. I had trouble reading these
files with "read", e.g., the following file is only 488 KB but takes about 13
minutes to read on my system because it has tens of thousands of abbreviations:
http://www.cs.utexas.edu/users/jared/Milawa/Sources/ACL2/bootstrap/utilities/proofs/thm-equal-of-booleans-rewrite.proof
The inefficiency seems to stem from the use of alists to manage abbreviations
in sharp-equal and sharp-sharp. (There's even a comment in reader.lisp which
calls this a kludge and suggests hash tables might be more appropriate.)
I wrote a patch to replace these alists with hash tables. As a result, the
above file can be loaded in 2 seconds (versus 790 seconds for the unpatched
sbcl from cvs), using the following code:
(defconstant *unique-cons-for-eof* (cons 'unique-cons 'for-eof))
(defun read-entire-file-at-once-aux (stream)
(let ((input (read stream nil *unique-cons-for-eof*)))
(if (eq input *unique-cons-for-eof*)
nil
(cons input (read-entire-file-at-once-aux stream)))))
(defun read-entire-file-at-once (filename)
(read-entire-file-at-once-aux (open filename
:direction :input
:if-does-not-exist :error)))
(time (let ((result (read-entire-file-at-once
"/home/jared/thm-equal-of-booleans-rewrite.proof")))
(declare (ignore result))
nil))
It would be great if this patch could be incorporated into the next release of
SBCL. Since this is my first time contributing to SBCL, I am not sure how to
provide my patch in the most useful way. I have included two diffs, one for
src/code/reader.lisp and one for src/code/sharpm.lisp. If you would prefer some
other format, please let me know and I'll be happy to package up the changes in
some other way.
Cheers,
Jared
--
Jared C. Davis <jared@...>
3600 Greystone Drive #604
Austin, TX 78731
http://www.cs.utexas.edu/users/jared/