I have this routine:
|(defun slurp-bytes (filename) "Return the entire contents of FILENAME
as a (unsigned-byte 8) vector. Results are cached in *bytes-cache* so
each file is read only once." (or (gethash filename *bytes-cache*) (setf
(gethash filename *bytes-cache*) (with-open-file (s filename :direction
:input :element-type '(unsigned-byte 8)) (let* ((len (file-length s))
(buf (make-array len :element-type '(unsigned-byte 8)))) (read-sequence
buf s) buf))))) |
When reading maxima.info-1 (1030671 bytes), it takes a very long time
(several seconds). Is there anyway to speed this up? I would have
expected reading a bunch of bytes from a file via read-sequence would be
very fast.
​
- Read-sequence is slow? Raymond Toy
-