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

Re: output streams vs output ports

This page is part of the web mail archives of SRFI 68 from before July 7th, 2015. The new archives for SRFI 68 contain all messages, not just those from before July 7th, 2015.

Shiro Kawai <shiro@xxxxxxxx> writes:

> The simple-minded copy program:
>    (call-with-input-file "/usr/share/dict/words"
>      (lambda (in)
>        (call-with-output-file "/dev/null"
>          (lambda (out)
>            (do ((c (read-char in) (read-char in)))
>                ((eof-object? c))
>              (write-char c out))))))
> It runs 3.5x faster if I bypass locking of 'in' and 'out' ports
> in Gauche.

Could you selectively bypass the locking of only the input port so we
get a better idea what the specific issue with the output port is?
(In the stream layer, the pragmatics of buffering are very different
for input and output.)

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla