[cvs-nhc98] Add a new faster implementation of input I/O.

Malcolm Wallace malcolm@sparud.net
Tue, 13 Feb 2001 15:12:19 +0100 (CET)


malcolm: Tue Feb 13 15:12:19 CET 2001

Update of /usr/src/master/nhc/src/prelude/IO
In directory hinken:/tmp/cvs-serv19388/src/prelude/IO

Modified Files:
	HGetContents.hs 
Log Message:
Add a new faster implementation of input I/O.

  * There is a new bytecode instruction HGETS, and a new primitive
        Builtin.hgets that uses it.
  * The compiler recognises a special symbol _hGetStr and generates
        the new bytecode HGETS for it.
  * IO.hGetContents uses the special symbol _hGetStr, and hence the
        new bytecode.

We achieve a 1.5x to 3x speed-up for raw lazy input.  Unless a real
program is very heavily input-bound, this won't give a vast saving,
but for instance nhc98 is now 2.5% faster at building itself.

Note: because the bytecodes have changed, this commit is a BREAKING
change.  You cannot mix old compiled code with new compiled code.