[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LISPM I/O performance



    Date: Thu, 25 Jan 90 14:21:29 -0500
    From: kanderso@dino.bbn.com
      where does something like READ-LINE fit into all this? I've used that in
      some places.
  
    READ-LINE cons a new line each time it is called.  For most
    applications this is needless.  :STRING-LINE-IN will fill a line that
    you provide it, so no consing is done.

To add to this:  :STRING-LINE-IN does copy the data.  :READ-INPUT-BUFFER
does not copy, but only works on buffered streams (I think all
:ELEMENT-TYPE 'STRING-CHAR file streams are buffered in 7.x, and
:ELEMENT-TYPE 'CHARACTER streams will be buffered in 8.0, I think).

If you're dealing in lines, and will need to copy the data into
your data structure anyway, :STRING-LINE-IN is your best way to
go.  If you are only going to look at the data, :READ-INPUT-BUFFER
is the most efficient, but you have to worry about buffer boundaries.
(If line length is finite, you don't have to worry about buffer
boundaries with :STRING-LINE-IN).