Good call. Got the time down with SBCL to 3.5 seconds. So still more than twice Java. ABCL with the same code with the big file (5.8G) is around 110+ seconds.
I'm still surprised by ABCL being SO much slower than SBCL especially with Java being faster than SBCL.
Thoughts?
Thanks,
Garrett.
P.S. I also took the "time" out, I am doing SBCL/ABCL the same way as I did in Java with the getting the start time before reading and getting the time after reading. and calculating the duration that way. It didn't make any difference that I could see in the times.
Lisp code:
(with-open-file (stream "/media/danger/OS/temp/great_expectations.iso"
:element-type '(unsigned-byte 8)
:external-format 'iso-8859-1) ; jars.txt iso-8859-1 also tried :default and the time was the same
(let ((size (file-length stream))
(buffer-size (* 16 1024 1024)) ; 16M
(start (get-internal-real-time))
)
(loop with buffer = (make-array buffer-size :element-type '(unsigned-byte 8))
for n-characters = (read-sequence buffer stream)
while (< 0 n-characters))
(format t "took ~,2f secs" (/ (- (get-internal-real-time) start)
internal-time-units-per-second))
))