From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#40355: [PATCH] Implement caching for libravatar lookup Date: Tue, 31 Mar 2020 21:58:49 +0200 Message-ID: References: <20200331180336.2999-1-philip@warpmail.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="35442"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40355@debbugs.gnu.org To: Philip K Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 31 21:59:21 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJN2f-000961-6C for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 Mar 2020 21:59:21 +0200 Original-Received: from localhost ([::1]:43692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJN2e-0005pw-8n for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 Mar 2020 15:59:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56878) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJN2O-0005nA-JB for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 15:59:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJN2N-0000gN-Jy for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 15:59:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJN2N-0000fc-GQ for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 15:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jJN2M-00019G-9E for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 15:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Mar 2020 19:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40355 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40355-submit@debbugs.gnu.org id=B40355.15856847394404 (code B ref 40355); Tue, 31 Mar 2020 19:59:02 +0000 Original-Received: (at 40355) by debbugs.gnu.org; 31 Mar 2020 19:58:59 +0000 Original-Received: from localhost ([127.0.0.1]:37056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJN2J-00018y-Aq for submit@debbugs.gnu.org; Tue, 31 Mar 2020 15:58:59 -0400 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:32982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJN2H-00018R-60 for 40355@debbugs.gnu.org; Tue, 31 Mar 2020 15:58:57 -0400 Original-Received: by mail-wm1-f44.google.com with SMTP id z14so2808364wmf.0 for <40355@debbugs.gnu.org>; Tue, 31 Mar 2020 12:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=YUQ1lfCGchw4T6Gd9v5FJu2aDP9S4nd7osY7qXoiDYk=; b=Q9A6I+8U+KYPvDLLMkLsasMBhsX0CZgIwJLZP5HbE6c6CIAFYMQwLIjBCzMFiRo2/T oGeQOygm2C4eVFham5M4VBmexB45Qskn8p4kIfespx4Fc9y68rFgoy67dbogVGrTSWcF 39qQYN4GFUJO3HLnd7OqpevhzyqBOrFQyiX0J5e3+mwidc2Dt8yfHf52aWmBVrFcY/+Y aP2dXrms/VSLi0MIcfSqzoV472AAls6njEUZbLGaEK9iUB00ECCob0spu7Bm4q5UU3nZ 5KDyX+I2w9h4VATKen5dRZEsf/KtTs+a2rWh7wRkwXFhjb7tf5tiuAO1JuOflkWfhbEg gO8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=YUQ1lfCGchw4T6Gd9v5FJu2aDP9S4nd7osY7qXoiDYk=; b=ofmN66XtkJeeBp7v8oYcZif5LEtL52qrwYWkvJMPSb2g5cLusQPh+GgxY3016wKzjV mNyxKxwQ/BfMAKNvI15QPrsXzfSsIx+YB7HBTxjCHyJKV2sLIW2O/eyCWrfYfqD5HIZg qE6e1EPozUi5LMMR9tMm8Di2KzOzmxmd6jRYU+glJFWfxg5tDmGmppaXl52YPQbKXekX o9U2Ud7vtxxjcxSJ3RJpxBp9aTDzymOX8fe5VPx8L8natfvtOMamQMR0EJpqg0argHO4 ooLZFBVofWAiyYouU8v7W9MD/+de5Y7j+PDCt9ApqqZwNhn4xlWHCH7vUz18uVVAzLti vw7Q== X-Gm-Message-State: AGi0PuYCTIr7h1SI2zO96ro3MUx4K5h2H5HUxYjWtStE1pIcqRU7wL6U of9u2JuXYFlJqgRtMLxic7d9GXNU X-Google-Smtp-Source: APiQypLEz3N4GpDOQdbts18j6xMq8vkn9fS0mmBcEaYC4KrFelX/Yho+Evz7Ah2dretZqQrwv1gHpw== X-Received: by 2002:a05:600c:2c4d:: with SMTP id r13mr502809wmg.146.1585684730696; Tue, 31 Mar 2020 12:58:50 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:65f2:9a92:2c96:9204]) by smtp.gmail.com with ESMTPSA id v26sm28960106wra.7.2020.03.31.12.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 12:58:50 -0700 (PDT) In-Reply-To: <20200331180336.2999-1-philip@warpmail.net> (Philip K.'s message of "Tue, 31 Mar 2020 20:03:36 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177928 Archived-At: >>>>> On Tue, 31 Mar 2020 20:03:36 +0200, Philip K said: Philip> Checking if a domain has an avatar server associated with it requires Philip> at most two (synchronous) DNS queries, at least to ultimately default Philip> to "libravatar.org". Caching the results of domain lookups reduced the Philip> evaluation time (on my machine) from ~0.3s to an instantaneous Philip> evaluation. I doubt you need the 'cache' arg, you can keep the cache purely internal. How big is this cache likely to get? Perhaps use a weak hash table? Robert