Re: STk I/O Performance

From: <kanderso_at_BBN.COM>
Date: Sat, 29 Apr 95 15:27:06 -0400

  X-Mailer: exmh version 1.5.1 12/2/94
  To: Andrew Joseph Kompanek <ak10+_at_andrew.cmu.edu>
  Cc: stk_at_kaolin.unice.fr
  Subject: Re: STk I/O Performance
  Reply-To: eg_at_unice.fr
  Mime-Version: 1.0
  Content-Type: text/plain; charset="us-ascii"
  Date: Tue, 18 Apr 1995 11:16:55 +0100
  From: Erick Gallesio <eg_at_kaolin.unice.fr>
  X-Mailing-List: <stk_at_kaolin.unice.fr> archive/latest/571
  X-Loop: stk_at_kaolin.unice.fr
  Precedence: list
  
  
  The problem seems to have several causes and makes things hard to find where
  time is exactly consumed.
  
  There must be some control which must be done each time a character is read
  (i.e. see if port is a port file and verify that the port is opened for
  reading). Of course, this calls must be done for each character even if port
  doesn't change between each call. Furthermore, the read-char primitive calls a
  low level function of the interpreter which takes into account string ports
  and Control-C interrupts....
  I have tried to replace the standard read-char by a new primitive which makes
  no test at all (!!). This primitive was simply:
          PRIMITIVE fast_read_char(SCM port)
          {
            int c;
  
            c = fgetc(port->storage_as.port.f);
            return (c == EOF) ? STk_eof_object : STk_makechar(c);
          }
  I was surprised to sse that the gain was very small (from 25Kb/s to 28Kb/s).
  Consequently, I have tried to see how to optimize further the reading of this
  file.
  
A clean way to do this would be to have a function,
(fast-read-char-function port), say, that would return a function that is
as fast as possible for that port. This essentially lifts all the checking
out of the loop.
Received on Sat Apr 29 1995 - 21:31:49 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST