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

Re: output streams vs output ports



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