From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: Re: RPC performance Date: Fri, 23 Jun 2017 11:09:23 +0200 Message-ID: References: <20170527105641.9426-1-mail@cbaines.net> <20170527123113.1ca668e7@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]:43233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dOKau-00045r-Kk for guix-devel@gnu.org; Fri, 23 Jun 2017 05:09:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dOKar-0002wt-E6 for guix-devel@gnu.org; Fri, 23 Jun 2017 05:09:36 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:54538 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dOKar-0002wo-9r for guix-devel@gnu.org; Fri, 23 Jun 2017 05:09:33 -0400 In-Reply-To: <87injoc8jw.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Thu, 22 Jun 2017 18:05:07 +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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org On Thu 22 Jun 2017 18:05, ludovic.courtes@inria.fr (Ludovic Court=C3=A8s) w= rites: > 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? Andy