From ... From: Erik Naggum Subject: Re: Good I/O performance Date: 1998/04/17 Message-ID: <3101793694278498@naggum.no>#1/1 X-Deja-AN: 344959971 References: <3536B704.4FB4E07F@infinet.com> <6h71rk$pej$1@nnrp1.dejanews.com> mail-copies-to: never Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * 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.