Subject: Re: Good I/O performance
From: Erik Naggum <clerik@naggum.no>
Date: 1998/04/17
Newsgroups: comp.lang.lisp
Message-ID: <3101793694278498@naggum.no>


* Kalman Reti
| For I/O performed in bigger chunks, the answer is usually that the data
| needs to be copied (often more than once).  Symbolics's lisp has an
| in-place I/O call (:read-input-buffer, used in the CMU example file),
| which returns the operating system's buffer along with start and limit
| indices, so that user code could operate directly on it without copying,
| but Common Lisp didn't adopt anything like it.

  what about READ-SEQUENCE and WRITE-SEQUENCE?

  I have found READ-SEQUENCE and WRITE-SEQUENCE to give reasonably good
  performance, and they can indeed overwrite existing buffers.  however, I
  did notice a factor of four decrease in system CPU time when I tuned the
  internal buffer size to equal a disk block.  in Allegro CL:

(setf excl::stream-buffer-size 8192)

  this also helped a little with the speed of ordinary I/O, but it was
  obviously drowned by more expensive operations.

  also important: in Allegro CL, one can allocate large buffers in "old
  space" and avoid the copying garbage collector overhead, like I did in
  the just posted MAP-FILE-TO-STRING, so the GC overhead is eliminated.
  this makes READ-SEQUENCE an even better choice.

#:Erik
-- 
  on the Net, _somebody_ always knows you're a dog.