guile-devel
[Top][All Lists]
Advanced

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

Re: Unexpectedly low read/write performance of open-pipe


From: Rob Browning
Subject: Re: Unexpectedly low read/write performance of open-pipe
Date: Tue, 09 Apr 2019 01:56:37 -0500

Mark H Weaver <address@hidden> writes:

> See below for a draft reimplementation of the OPEN_BOTH mode of
> open-pipe* based on R6RS custom binary input/output.  On my machine it
> increases the speed of your test by a factor of ~1k.

Hah, I was about to report that I'd tested something along similar lines
(though much more a quick hack to just replace make-rw-port and see what
happened), and that I had seen substantial improvements:

  (define (make-rw-bin-port read-port write-port)
    (define (read! dest offset count)
      (let ((result (get-bytevector-n! read-port dest offset count)))
        (if (eof-object? result) 0 result)))
    (define (write! src offset count)
      (put-bytevector write-port src offset count)
      count)
    (define (close x)
      (close-port read-port)
      (close-port write-port))
    (make-custom-binary-input/output-port "open-bin-pipe-port"
                                          read! write! #f #f
                                          close))

> Let me know how it works for you.

For a first quick test of your patch using the original program I was
working on, I see about ~1.4MiB/s without the patch, and about 150MiB/s
with it, measured by pv.

(If the patch holds up, it'd be nice to have in 2.2, but I suppose that
 might not be appropriate.)

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]