From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludovic.courtes@inria.fr (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: RPC performance Date: Fri, 23 Jun 2017 11:24:50 +0200 Message-ID: <87y3sjawf1.fsf@inria.fr> References: <20170527105641.9426-1-mail@cbaines.net> <87tw424cap.fsf@gnu.org> <87fufhkw85.fsf@gnu.org> <871sr0ok2h.fsf@gnu.org> <8760gbh2th.fsf@gnu.org> <87efuym57c.fsf@gnu.org> <87a85kt7ad.fsf_-_@gnu.org> <87a85hnvqm.fsf@gnu.org> <87tw3lyz7t.fsf@inria.fr> <87poe4c5y9.fsf_-_@gnu.org> <87fuezkquf.fsf@gnu.org> <87lgoq8ch8.fsf@gnu.org> <87k2497kk7.fsf@elephly.net> <87vans1k5e.fsf_-_@inria.fr> <87poe01jgo.fsf@gnu.org> <87o9tg5dbm.fsf@igalia.com> <87injoc8jw.fsf@inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dOKq5-0007M4-2Y for guix-devel@gnu.org; Fri, 23 Jun 2017 05:25:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dOKpz-0008J7-Oc for guix-devel@gnu.org; Fri, 23 Jun 2017 05:25:16 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:22063) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dOKpz-0008GQ-Cp for guix-devel@gnu.org; Fri, 23 Jun 2017 05:25:11 -0400 In-Reply-To: (Andy Wingo's message of "Fri, 23 Jun 2017 11:09:23 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Andy Wingo Cc: guix-devel@gnu.org Hi Andy, Andy Wingo skribis: > On Thu 22 Jun 2017 18:05, ludovic.courtes@inria.fr (Ludovic Court=C3=A8s)= writes: > >> Andy Wingo skribis: >> >>> Why not just set to _IOFBF and let Guile 2.2's buffering handle it? >> >> Because we want controlled buffering when writing (we need to flush >> pending output when we=E2=80=99re done writing the RPC request), and no >> buffering at all when reading. > > For controlling output buffering, there is the setvbuf buffer size, and > "force-output". In Guile 2.2 the CBOP's "write" function is really a > "flush" function -- it only gets called when the internal buffer is > filled, or when flush-output is called, or (for line-buffered ports) > when a newline is written. > > Why do you not want buffering when reading? Do you need to hand off > this FD to some other process? With the current protocol, often we=E2=80=99re just reading a handful of by= tes. Full buffering would mean that Guile would block on an 8K read or so that will never be fulfilled. Ludo=E2=80=99.