From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AtiHKD25V2ASVgAA0tVLHw (envelope-from ) for ; Sun, 21 Mar 2021 21:23:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OJVUJD25V2B8egAAB5/wlQ (envelope-from ) for ; Sun, 21 Mar 2021 21:23:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EA59D2C4CB for ; Sun, 21 Mar 2021 22:23:08 +0100 (CET) Received: from localhost ([::1]:58386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lO5XQ-0000Tn-3b for larch@yhetil.org; Sun, 21 Mar 2021 17:23:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lO5XK-0000Te-9I for bug-guix@gnu.org; Sun, 21 Mar 2021 17:23:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lO5XK-0002gb-0i for bug-guix@gnu.org; Sun, 21 Mar 2021 17:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lO5XJ-000231-Pz for bug-guix@gnu.org; Sun, 21 Mar 2021 17:23:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47283: Performance regression in narinfo fetching Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 21 Mar 2021 21:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47283 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Christopher Baines Received: via spool by 47283-submit@debbugs.gnu.org id=B47283.16163617417820 (code B ref 47283); Sun, 21 Mar 2021 21:23:01 +0000 Received: (at 47283) by debbugs.gnu.org; 21 Mar 2021 21:22:21 +0000 Received: from localhost ([127.0.0.1]:55572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lO5Wf-000224-Bz for submit@debbugs.gnu.org; Sun, 21 Mar 2021 17:22:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lO5Wd-00021r-1s for 47283@debbugs.gnu.org; Sun, 21 Mar 2021 17:22:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44535) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lO5WX-0002Nq-JX; Sun, 21 Mar 2021 17:22:13 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39086 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lO5WW-0003kt-SH; Sun, 21 Mar 2021 17:22:13 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87ft0p67z4.fsf@inria.fr> <874kh5d0rg.fsf@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 1 Germinal an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 21 Mar 2021 22:22:10 +0100 In-Reply-To: <874kh5d0rg.fsf@cbaines.net> (Christopher Baines's message of "Sat, 20 Mar 2021 20:32:35 +0000") Message-ID: <87czvs19tp.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 47283@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616361789; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=QtW1JDaSFbE0M1Nr1F8f9RSjuzPrMJTZCiGkFtI63lQ=; b=dYek8Zxl3HgiNb96CccdNLzBrlcgAn3Pcu9t4otSDP1DzNtyo/YkHn2Jc/k1I3SfIAT7cF +w8SnJ/vOt6t2tbMordwfMVYy2uvuqT5q2F/zIejkaavxVS8WF4lGX/S+rabETuhGGTqOm 32AIR/I5hHGDNR/eZPmo18Y2QNOFm4D2ewE3iPBRrY6eeTUSTwVzCSugqOs9ceXbtDzAWJ PbRiPNnP9DnlB4GOCuFXZntBjJ8OF9sGbYk06u2OwVCNRm/GWUTgV2LKm9pPolix8awMVV Bo+jY4wJHnsVv0aseu2T23JWD5SXk74SZOveMBEExzsWRN3E5lqC7ur7Mf2wIQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616361789; a=rsa-sha256; cv=none; b=ZIQrcntdvSWnRInIWOxf7fX8PCRTPnIdZm96jKS4ky+rWJulaKZI9v9tLwt2X4KA29+8h8 4sxsIoP1zolRwQhWg42tEmjAVdmDDOUjX01jSwi+4Glxg5w4V3gkozsNQp7/75ZCEe7d/F 6uMA4NussjQePQGrzZTbBbbQ8Ul2MIRR0DO2cDl8DeCwbPEYskop86JWgD677n9JvxeLr4 TRn7ANiSZaYEWNGU5cP3XPCK1geEbUuOWdBRcaRZ4yMXdVLmpXFAwmjgJ9TcRIdDhq5NCa WaCh4B/diupEr0IL7/bXh9e3vmHXijMNmyVwdfnFuiX3zY2nczSrNvftYg1Lpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: EA59D2C4CB X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: rNxgsyfI+T86 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Christopher Baines skribis: > Ludovic Court=C3=A8s writes: > >> Indeed, there=E2=80=99s one place on the hot path where we install excep= tion >> handlers: in =E2=80=98http-multiple-get=E2=80=99 (from commit >> 205833b72c5517915a47a50dbe28e7024dc74e57). I don=E2=80=99t think it=E2= =80=99s needed, >> is it? (But if it is, let=E2=80=99s find another approach, this one is >> prohibitively expensive.) > > I think the exception handling has moved around, but I guess the > exceptions that could be caught in http-multiple-get could happen, > right? I am really just guessing here, as Guile doesn't help tell you > about possible exceptions, and I haven't spent enough time to read all > the possible code involved to find out if these are definitely possible. Yeah. Commit 205833b72c5517915a47a50dbe28e7024dc74e57 added a =E2=80=98catch=E2= =80=99 block that catches the same things as =E2=80=98with-cached-connection=E2=80=99 di= d (it would be better to not duplicate it IMO). That includes EPIPE, gnutls-error, bad-response & co. Earlier, commit be5a75ebb5988b87b2392e2113f6590f353dd6cd (=E2=80=9Csubstitu= te: Reuse connections for '--query'.=E2=80=9D) did not add such a =E2=80=98catc= h=E2=80=99 block in =E2=80=98http-multiple-get=E2=80=99. Instead, it wrapped its call in =E2= =80=98do-fetch=E2=80=99 in =E2=80=98fetch-narinfos=E2=80=99: --=-=-= Content-Type: text/x-patch Content-Disposition: inline (define (do-fetch uri) (case (and=> uri uri-scheme) ((http https) - (let ((requests (map (cut narinfo-request url <>) paths))) - (match (open-connection-for-uri/maybe uri) - (#f - '()) - (port - (update-progress!) ;; Note: Do not check HTTPS server certificates to avoid depending ;; on the X.509 PKI. We can do it because we authenticate ;; narinfos, which provides a much stronger guarantee. - (let ((result (http-multiple-get uri + (let* ((requests (map (cut narinfo-request url <>) paths)) + (result (call-with-cached-connection uri + (lambda (port) + (if port + (begin + (update-progress!) + (http-multiple-get uri handle-narinfo-response '() requests + #:open-connection + open-connection-for-uri/cached #:verify-certificate? #f - #:port port))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This bit is still there in current =E2=80=98master=E2=80=99, so I think it= =E2=80=99s not necessary to catch these exceptions in =E2=80=98http-multiple-get=E2=80=99 = itself, and I would just remove the =E2=80=98catch=E2=80=99 wrap altogether. WDYT? Thanks, Ludo=E2=80=99. --=-=-=--