From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 14:03:50 2020 Received: (at submit) by debbugs.gnu.org; 31 Mar 2020 18:03:50 +0000 Received: from localhost ([127.0.0.1]:36984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJLEo-0005P5-79 for submit@debbugs.gnu.org; Tue, 31 Mar 2020 14:03:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:48852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJLEm-0005Oy-EY for submit@debbugs.gnu.org; Tue, 31 Mar 2020 14:03:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57173) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJLEk-00008F-Kr for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 14:03:44 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,SPOOFED_FREEMAIL,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJLEj-00014J-5i for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 14:03:42 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:34763) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJLEi-00013x-Kc for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 14:03:41 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id ABC14A17 for ; Tue, 31 Mar 2020 14:03:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 31 Mar 2020 14:03:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=warpmail.net; h= from:to:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=mbNubDYKYS9m7e2W0DSRTLbmw1 crGLoiZ+gjug0tvsg=; b=pr6KsyvaaOXcQFagc8r3xe8FJzhETcCYiSgUyvyZnJ aFXLJtckJ+QFv+J1toipoj+k5QroamGF1TFVwn1Tw8ZZE/Gt3bmMbFF1Bru+RVeO jqpw5jqyEm4Ce988AIFp0EOKjtPS+0KX6Lg4vkMDfgv81xmkn8+Lt9FGrIms1OOs r+vFnvTuIInE5v/XKXrkLHuMVTIcIGQU1vD6V+XOofknY8aSuAG6B+lJZTF2R4uw Cydbz8r6QWVNi0Q9Wyio/J5hpIQI9BHjRfmElQDzT2JG9BexW+dWCJXUp9mg3s0G 0vTxWfER5n+ksIzN+mBcaqtcEH1w9ejnG129h9d8qzag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=mbNubDYKYS9m7e2W0 DSRTLbmw1crGLoiZ+gjug0tvsg=; b=4aNg4qq957M+c6dasRV4YqT6/TjVDrcuf wQmH2JcL1+L4iS+4cPXiojUhtcBQbkw8qjbY+7Mnrn50VKtgIItzaqBcPyHB8MtZ QqyXvAwJyuTtqmiLx3/aN7KuuhAk1Z4zTCZQee04KaUFdDZrwWbGBzBmKvV8uAO7 3HYmzuO40si/sB9N8AxLjs4MhzTGsQH98y0zz3XG7RBOOijwn2qq/rrlHvmzp1FW m9XHvwbyY5IywtyCHJzpemzOE4oZsZfuePrBXrVff1ZjOr8HfUOccMYW5OAkQAPF 3eHYjoIZiXKUZVwPzMhLTzJzniIs/3EwNvQMTUyZx4lp0iRL+ZD/A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrtddtgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpefrhhhilhhiphcumfcuoehphhhilhhiphesfigrrhhpmhgrihhlrdhn vghtqeenucffohhmrghinheplhhisghrrghvrghtrghrrdhorhhgpdhgrhgrvhgrthgrrh drtghomhenucfkphepjeelrddvudelrdduleelrddufedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpseifrghrphhmrghilh drnhgvth X-ME-Proxy: Received: from localhost (p4fdbc782.dip0.t-ipconnect.de [79.219.199.130]) by mail.messagingengine.com (Postfix) with ESMTPA id D83F7328005D for ; Tue, 31 Mar 2020 14:03:38 -0400 (EDT) From: Philip K To: bug-gnu-emacs@gnu.org Subject: [PATCH] Implement caching for libravatar lookup Date: Tue, 31 Mar 2020 20:03:36 +0200 Message-Id: <20200331180336.2999-1-philip@warpmail.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.19 X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Checking if a domain has an avatar server associated with it requires at most two (synchronous) DNS queries, at least to ultimately default to "libravatar.org". Caching the results of domain lookups r [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gravatar.com] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (philip[at]warpmail.net) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Checking if a domain has an avatar server associated with it requires at most two (synchronous) DNS queries, at least to ultimately default to "libravatar.org". Caching the results of domain lookups reduced the evaluation time (on my machine) from ~0.3s to an instantaneous evaluation. * lisp/image/gravatar.el (gravatar--service-libravatar): Check if domain has already been resolved before staring DNS queries (gravatar-libravatar-cache): New variable. --- lisp/image/gravatar.el | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el index a9cd540aa4..2572f9136f 100644 --- a/lisp/image/gravatar.el +++ b/lisp/image/gravatar.el @@ -138,14 +138,24 @@ gravatar-service :link '(url-link "https://gravatar.com/") :group 'gravatar) -(defun gravatar--service-libravatar (addr) - "Find domain that hosts avatars for email address ADDR." +(defvar gravatar-libravatar-cache (make-hash-table :test 'equal) + "Cache for `gravatar--service-libravatar'.") + +(defun gravatar--service-libravatar (addr &optional cache) + "Find domain that hosts avatars for email address ADDR. +The optional argument CACHE must either be a hash table to +memorise avatar server resolutions in, or nil, in which case it +will default to `gravatar-libravatar-cache'." ;; implements https://wiki.libravatar.org/api/ (save-match-data (if (not (string-match ".+@\\(.+\\)" addr)) "https://seccdn.libravatar.org/avatar" - (let ((domain (match-string 1 addr))) + (let ((domain (downcase (match-string 1 addr)))) (catch 'found + (setq cache (or cache gravatar-libravatar-cache)) + (let ((cache (gethash domain cache))) + (when (and cache (time-less-p (current-time) (cdr cache))) + (throw 'found (car cache)))) (dolist (record '(("_avatars-sec" . "https") ("_avatars" . "http"))) (let* ((query (concat (car record) "._tcp." domain)) @@ -173,12 +183,24 @@ gravatar--service-libravatar (<= 1 (dns-get 'port rec) 65535) (string-match-p "\\`[-.0-9A-Za-z]+\\'" (dns-get 'target rec))) - (throw 'found (format "%s://%s:%s/avatar" - (cdr record) - (dns-get 'target rec) - (dns-get 'port rec)))) - (setq sum (- sum (dns-get 'weight rec))))))) - "https://seccdn.libravatar.org/avatar")))))) + (let ((url (format "%s://%s:%s/avatar" + (cdr record) + (dns-get 'target rec) + (dns-get 'port rec))) + (timeout (if (time-less-p + (seconds-to-time (dns-get 'ttl rec)) + (days-to-time 1)) + (days-to-time 1) + (seconds-to-time (dns-get 'ttl rec))))) + (puthash domain + (cons url (time-add (current-time) timeout)) + cache) + (throw 'found url))) + (setq sum (- sum (dns-get 'weight rec)))))))) + (car (puthash domain + (cons "https://seccdn.libravatar.org/avatar" + (time-add (current-time) (days-to-time 30))) + cache))))))) (defun gravatar-hash (mail-address) "Return the Gravatar hash for MAIL-ADDRESS." -- 2.20.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 15:58:59 2020 Received: (at 40355) by debbugs.gnu.org; 31 Mar 2020 19:58:59 +0000 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 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 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) 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) From: Robert Pluim To: Philip K Subject: Re: bug#40355: [PATCH] Implement caching for libravatar lookup References: <20200331180336.2999-1-philip@warpmail.net> Date: Tue, 31 Mar 2020 21:58:49 +0200 In-Reply-To: <20200331180336.2999-1-philip@warpmail.net> (Philip K.'s message of "Tue, 31 Mar 2020 20:03:36 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40355 Cc: 40355@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 17:30:45 2020 Received: (at 40355) by debbugs.gnu.org; 31 Mar 2020 21:30:45 +0000 Received: from localhost ([127.0.0.1]:37145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJOT1-0005tA-4J for submit@debbugs.gnu.org; Tue, 31 Mar 2020 17:30:45 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:52303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJOSy-0005sa-AX for 40355@debbugs.gnu.org; Tue, 31 Mar 2020 17:30:37 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 845E0363; Tue, 31 Mar 2020 17:30:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 31 Mar 2020 17:30:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=warpmail.net; h= from:to:cc:subject:in-reply-to:date:message-id:mime-version :content-type; s=fm3; bh=d5kouLmlUpSv1upvk9MUT1B6h5zc2Kia3OR7u6+ EoeQ=; b=nUIlPwLcLydAP9BgYfVlJswfKUfmEs/tksWZRBLgxOIUWNRjczH67MZ 9eQCug1sPECEy9mRuxXFPQd1veHuyECRoRVpcs33zFkfb6j1bfHPr3LrcOUJelpI AzC9mB/BlzjyikkoGrXnFHrofEH6ZoVOvaSzXjqFMz1/6/QufBEzIGiuiXLWvzkr nl9vdE3QeTP5J+XA7p0av2l3Jh3bcjMmERMbsvCxYvL0MDBufhUApQUjxEu+JemV NOzmdd93xci4RQss82BfWWAXq3bR3H+3rv772YYW5jpSgEZQdUWjX3zgI8XCQ4KY NufFePEeX2/psW3c0IlF9AwNzmNPm5g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=d5kouLmlUpSv1upvk 9MUT1B6h5zc2Kia3OR7u6+EoeQ=; b=yF4UKPmQ9HUGoHtV6eF7js3m5gIwfyE13 NyCRDo427J+4Ic5yZTZVHHFBmNAccrvMQkxZNsnV6jOoPQvn4sGIKWVjDlVdiSzp POyEPwYYm6sO+XaXVp/r4mOqdOluL9YOzWkBd61zXFyJpEHiIjdFl0h3XitmM4Ro y5Wu+KxyIcnA77C2DCO0oVpYQ8s3LCO3orQJ1phUDUarZzLQsrJZ1jnBDKlsOPYB mlaw8vVMRz6uiIKRp7ZXnDglOg5dJrNnewbPbUuMdosWq9SIrgquyCq9V6W5Dg9H Ip45H4lVHY3uZAebq3pSOXcz9mtEguOjSn5Y+O6ItJMhejLDOANfA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrtddtgdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfffkgggtsehttdertddttddtnecuhfhrohhmpehphhhilhhiphes figrrhhpmhgrihhlrdhnvghtucdlrfhhihhlihhpucfmrddmnecuffhomhgrihhnpegrth htrdhnvghtpdhfrggtvggsohhokhdrtghomhdpghhoohhglhgvmhgrihhlrdgtohhmpdgt ohhmmhgvrdgtohhmpdhmrghilhdrtghomhdpmhhsnhdrtghomhdpshgstghglhhosggrlh drnhgvthenucfkphepjeelrddvudelrdduleelrddufedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpseifrghrphhmrghilh drnhgvth X-ME-Proxy: Received: from localhost (p4fdbc782.dip0.t-ipconnect.de [79.219.199.130]) by mail.messagingengine.com (Postfix) with ESMTPA id 53DBE328005E; Tue, 31 Mar 2020 17:30:29 -0400 (EDT) From: philip@warpmail.net (Philip K.) To: Robert Pluim Subject: Re: bug#40355: [PATCH] Implement caching for libravatar lookup In-Reply-To: (message from Robert Pluim on Tue, 31 Mar 2020 21:58:49 +0200) Autocrypt: addr=philip@warpmail.net; prefer-encrypt=mutual; keydata= mDMEXmoX2BYJKwYBBAHaRw8BAQdA/YuGV2Dy6UZtMk+KfA7Nnlj38k22KQ/+sXVa2ttGaHm0O1Bo aWxpcCBLLiAoZ2VuZXJhdGVkIGJ5IGF1dG9jcnlwdC5lbCkgPHBoaWxpcEB3YXJwbWFpbC5uZXQ+ iJAEExYIADgWIQSx6XCgW+bhLMR4DmPClWiPoyRe6AUCXmoX2AIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAAKCRDClWiPoyRe6IDNAP0eOlYoYIGVcCinuewkEb762T6lqA2hIHcNeRyX8LyQ8gEA krv4pIlZNLF+nBvaCtKvCPZF9428X50CvNvRHCNqgwe4OAReahfYEgorBgEEAZdVAQUBAQdACM09 XXce+t9YpOLbLdESh5g4RTY/0Zys7U1FapIZLA4DAQgHiHgEGBYIACAWIQSx6XCgW+bhLMR4DmPC lWiPoyRe6AUCXmoX2AIbDAAKCRDClWiPoyRe6LYcAQDn15KGn/E9MqloWN4mBJ7/tepYIk2IxrkZ imC531HsIAD+LKQYjorQosVe1oym0VZjmgKsem1kJZHG2tY601I+QwM= Date: Tue, 31 Mar 2020 23:30:23 +0200 Message-ID: <87d08sp5zk.fsf@bulbul> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40355 Cc: 40355@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Pluim writes: >>>>>> On Tue, 31 Mar 2020 20:03:36 +0200, Philip K said: > > I doubt you need the 'cache' arg, you can keep the cache purely > internal. I added it because I was considering defining gravatar-libravatar-cache as (let ((cache (make-hash-table :test 'equal))) (dolist (domain '("aol.com" "att.net" "comcast.net" "facebook.com" "gmail.com" "gmx.com" "googlemail.com" "google.com" "hotmail.com" "hotmail.co.uk" "mac.com" "me.com" "mail.com" "msn.com" "live.com" "sbcglobal.net" ;; ... )) (gravatar--service-libravatar (concat "ignored@" domain) cache)) cache) with a few popular domains. The only issue is that evaluating it takes forever. > How big is this cache likely to get? Perhaps use a weak hash table? I haven't managed to gather good real-world data yet, but I would assume something along the lines of 50-200 domains? -- Philip K. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 01 03:27:15 2020 Received: (at 40355) by debbugs.gnu.org; 1 Apr 2020 07:27:15 +0000 Received: from localhost ([127.0.0.1]:37401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJXmI-0001PQ-Hn for submit@debbugs.gnu.org; Wed, 01 Apr 2020 03:27:15 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]:56250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJXmG-0001Oi-Dl for 40355@debbugs.gnu.org; Wed, 01 Apr 2020 03:27:08 -0400 Received: by mail-wm1-f41.google.com with SMTP id r16so5392756wmg.5 for <40355@debbugs.gnu.org>; Wed, 01 Apr 2020 00:27:08 -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:content-transfer-encoding; bh=jnPaNQaiNTv4rlTnNxhgLd7j2uJjkvPwgFRc2hFiVms=; b=KyKq4d7zvp9RfyGEz5IqQiJp3JABW++brOdgGLU970Z6MbMVWGqTTp7Psnu/KwgUen 1+oWNhGVgoia5Rr4p93DN5QtQX17vXLCfmEhYMKoDK8usIdF0+ayuRorky0GBmKC4jvx FF7VYXN+Vo9dXAUXLE74OOOsF9CNuGl0eByhs4Di9egXxQ9JsE7/NQsYeROJpbJ72BaA CpuQpH/yaAVMrV/jrCBKH785bJ791FzDgPgucRSLOx6rMW4bBjf7P7gend55U0SgDdnw T0Z3TmpLI9EVCfFa/t6SKSTn3XWbGr8Hiw61Q5prylYuggatWxV68EtGsOPbNZgp+heC fEMg== 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:content-transfer-encoding; bh=jnPaNQaiNTv4rlTnNxhgLd7j2uJjkvPwgFRc2hFiVms=; b=fxTkHnxIQfU5ZRuLMPaprSKR/7KfDxZw4iLDY3o5CiD6Fi/a7FnkbltL5dnW/0bSnU iFIGKR9oWRSHYycdij+VokRgbGOlEbv/NTcTrOoCE93bOl1kwhkre3iih9juD0uOI/bu Q+2biRqexx3aeAUz8XWrrVC2tR8f2gbNnfd9miW6C59l6EAIu7gB4GICIMuR0NHqObOk M7l3ZdOKqJ5/gWxo2y3yEzDsb7MX3I2XLNxdmJE0DXwgz9+yfMwQtbas/bcD8Idltbey 6+LGXjhQtZ6vALEOeXkGxS7pQ/QQwDHA7YzrVSbPVgm6qjQ0NqK9wt0U9vlpCEzZO90p WKcg== X-Gm-Message-State: AGi0PuaVgkzWiYgfFtUQDjRdp+WIUm3KlEeVUaNf3NrIUzCvXDXr95ip sgQCty/Rm01LauOGsYM78e3XAFze X-Google-Smtp-Source: APiQypILBXcrvRHbPvUFXwx51QQgir7cd9O8fs8NzGb+wpUD+ENQE5zSBLE6gOYsb2iOmCTibhf9YA== X-Received: by 2002:a1c:7e11:: with SMTP id z17mr2933237wmc.151.1585726022022; Wed, 01 Apr 2020 00:27:02 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:65f2:9a92:2c96:9204]) by smtp.gmail.com with ESMTPSA id a2sm1790554wrp.13.2020.04.01.00.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 00:27:01 -0700 (PDT) From: Robert Pluim To: philip@warpmail.net (Philip K.) Subject: Re: bug#40355: [PATCH] Implement caching for libravatar lookup References: <20200331180336.2999-1-philip@warpmail.net> <87d08sp5zk.fsf@bulbul> Date: Wed, 01 Apr 2020 09:27:00 +0200 In-Reply-To: <87d08sp5zk.fsf@bulbul> (Philip K.'s message of "Tue, 31 Mar 2020 23:30:23 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 40355 Cc: 40355@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 31 Mar 2020 23:30:23 +0200, philip@warpmail.net (Philip K.) s= aid: Philip> Robert Pluim writes: >>>>>>> On Tue, 31 Mar 2020 20:03:36 +0200, Philip K said: >>=20 >> I doubt you need the 'cache' arg, you can keep the cache purely >> internal. Philip> I added it because I was considering defining gravatar-libravat= ar-cache Philip> as Philip> (let ((cache (make-hash-table :test 'equal))) Philip> (dolist (domain '("aol.com" "att.net" "comcast.net" "face= book.com" Philip> "gmail.com" "gmx.com" "googlemail.com" = "google.com" Philip> "hotmail.com" "hotmail.co.uk" "mac.com"= "me.com" Philip> "mail.com" "msn.com" "live.com" "sbcglo= bal.net" Philip> ;; ... Philip> )) Philip> (gravatar--service-libravatar (concat "ignored@" domain= ) cache)) Philip> cache) Philip> with a few popular domains. The only issue is that evaluating i= t takes Philip> forever. Perhaps that=CA=BCs a sign that pre-population is not needed :-) >> How big is this cache likely to get? Perhaps use a weak hash table? Philip> I haven't managed to gather good real-world data yet, but I wou= ld assume Philip> something along the lines of 50-200 domains? OK, I don=CA=BCt think that=CA=BCs onerous. Robert From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 01 06:34:51 2020 Received: (at 40355) by debbugs.gnu.org; 1 Apr 2020 10:34:51 +0000 Received: from localhost ([127.0.0.1]:37481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJahp-0006HH-OV for submit@debbugs.gnu.org; Wed, 01 Apr 2020 06:34:51 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:42387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJahn-0006H3-ID for 40355@debbugs.gnu.org; Wed, 01 Apr 2020 06:34:44 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 8558861B; Wed, 1 Apr 2020 06:34:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 01 Apr 2020 06:34:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=warpmail.net; h= from:to:cc:subject:in-reply-to:date:message-id:mime-version :content-type:content-transfer-encoding; s=fm3; bh=iLTZ3pXKiLRoO g6uxVIHXLVjQIm/cPtliZaHnwrxjfA=; b=DzE7nNpfixiaX9yfkQd2UGEtuORr2 2yVPEUavDnwBchIkCzxglaMlRCDmzOsdemU9sdH8owWS/9kwVqgNydkRzhHCef76 DTyxJQx/oX+Zrnffb7yMS/ORqPbHadnwoeduK5ClxZrfuc4E83aa6ylJ0TsQdvK3 /VWF4n322w0XAZ84B9qN1DpnUQsMRkgF1FaPpDvNs+LsQ7UDRqCKn6xHII3ObiAg WV1Qy4BY5EV2sh82mCxBhyjMIh8ME2AxZDvrFWLXUYJdO6Aw/Bmw48M2P6CfYyc4 Gp7tajGCm/21ZlLeis1VbVP0hPEqg2R00Of+u8kTxtpPQ+lWeFOXseaxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=iLTZ3pXKiLRoOg6uxVIHXLVjQIm/cPtliZaHnwrxjfA=; b=IWw5y1FW 4II6EbqBK+nlecvCrPVsktWLqu7qhGXNLja9tMt6zBOlrTELw1FyH74nwX8/5TEe P2gM5VZLs7HDCFFepOYkyBCYgNPTv0o9/yEJYC6SvYJJFETn+mmR4I/QjRFFSUAT VDWnXIfJDGmAtPKUFcjHIKhA8dG4KQeejYE65UkpmAbCyxEDBpiU7BDdoH5E7oVR hVNBaegR2SR54/nQim4C9x7N+Fhn9IsDeyqCijF5TJ3VuYcWiYrgeV1YXv+QuGaI pKKavO9VAbHKsQUxofF/HbdUgHC8HBQpbjhquVOBQlbzvZRePfzXfcmzJHheCr5C YQXIs+oBrq/XTQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrtddvgddvlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujgffkfggtgfgsehtqhertddttdejnecuhfhrohhmpehphhhilhhiphes figrrhhpmhgrihhlrdhnvghtucdlrfhhihhlihhpucfmrddmnecuffhomhgrihhnpegrth htrdhnvghtpdhfrggtvggsohhokhdrtghomhdpghhoohhglhgvmhgrihhlrdgtohhmpdgt ohhmmhgvrdgtohhmpdhmrghilhdrtghomhdpmhhsnhdrtghomhdpshgstghglhhosggrlh drnhgvthenucfkphepjeelrddvudelrdduleelrddufedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpseifrghrphhmrghilh drnhgvth X-ME-Proxy: Received: from localhost (p4fdbc782.dip0.t-ipconnect.de [79.219.199.130]) by mail.messagingengine.com (Postfix) with ESMTPA id A4014328005A; Wed, 1 Apr 2020 06:34:36 -0400 (EDT) From: philip@warpmail.net (Philip K.) To: Robert Pluim Subject: Re: bug#40355: [PATCH] Implement caching for libravatar lookup In-Reply-To: (message from Robert Pluim on Wed, 01 Apr 2020 09:27:00 +0200) Autocrypt: addr=philip@warpmail.net; prefer-encrypt=mutual; keydata= mDMEXmoX2BYJKwYBBAHaRw8BAQdA/YuGV2Dy6UZtMk+KfA7Nnlj38k22KQ/+sXVa2ttGaHm0O1Bo aWxpcCBLLiAoZ2VuZXJhdGVkIGJ5IGF1dG9jcnlwdC5lbCkgPHBoaWxpcEB3YXJwbWFpbC5uZXQ+ iJAEExYIADgWIQSx6XCgW+bhLMR4DmPClWiPoyRe6AUCXmoX2AIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAAKCRDClWiPoyRe6IDNAP0eOlYoYIGVcCinuewkEb762T6lqA2hIHcNeRyX8LyQ8gEA krv4pIlZNLF+nBvaCtKvCPZF9428X50CvNvRHCNqgwe4OAReahfYEgorBgEEAZdVAQUBAQdACM09 XXce+t9YpOLbLdESh5g4RTY/0Zys7U1FapIZLA4DAQgHiHgEGBYIACAWIQSx6XCgW+bhLMR4DmPC lWiPoyRe6AUCXmoX2AIbDAAKCRDClWiPoyRe6LYcAQDn15KGn/E9MqloWN4mBJ7/tepYIk2IxrkZ imC531HsIAD+LKQYjorQosVe1oym0VZjmgKsem1kJZHG2tY601I+QwM= Date: Wed, 01 Apr 2020 12:34:34 +0200 Message-ID: <87a73vpk91.fsf@bulbul> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40355 Cc: 40355@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Pluim writes: > Philip> I added it because I was considering defining gravatar-librav= atar-cache > Philip> as > > Philip> (let ((cache (make-hash-table :test 'equal))) > Philip> (dolist (domain '("aol.com" "att.net" "comcast.net" "fa= cebook.com" > Philip> "gmail.com" "gmx.com" "googlemail.com= " "google.com" > Philip> "hotmail.com" "hotmail.co.uk" "mac.co= m" "me.com" > Philip> "mail.com" "msn.com" "live.com" "sbcg= lobal.net" > Philip> ;; ... > Philip> )) > Philip> (gravatar--service-libravatar (concat "ignored@" doma= in) cache)) > Philip> cache) > > Philip> with a few popular domains. The only issue is that evaluating= it takes > Philip> forever. > > Perhaps that=CA=BCs a sign that pre-population is not needed :-) It's not needed, but as soon as it is pre-populated the user experience becomes a lot better. But unless there's a sensible way to fix it, I'll just resubmit the patch without the optional argument :/ --=20 Philip K. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 08 09:04:10 2020 Received: (at 40355) by debbugs.gnu.org; 8 Aug 2020 13:04:10 +0000 Received: from localhost ([127.0.0.1]:58484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4OWA-0007Kw-5g for submit@debbugs.gnu.org; Sat, 08 Aug 2020 09:04:10 -0400 Received: from quimby.gnus.org ([95.216.78.240]:51492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4OW7-0007Kj-Rs for 40355@debbugs.gnu.org; Sat, 08 Aug 2020 09:04:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7IYgMyD4WYkP2O1cUVBEThJwAuhHR/5O0NPh7Tk1XUU=; b=VoTL5CJu9SquwkpWk2UhR6cxqj RuS5c4KHs7NNjvVS+7SpgdcuCZ5VMm1qiE6ibVtEl01mVxJDfuHfEIWE+02Mb9GfHKIvc4mcTcaO+ G30kBuSZl2HxA+2PZYH+49aiIXly4Om0b5AFhJeE4hXJlgObtlEs2Li8ueB9lRIUWIew=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k4OVz-0004aG-HA; Sat, 08 Aug 2020 15:04:02 +0200 From: Lars Ingebrigtsen To: Philip K Subject: Re: bug#40355: [PATCH] Implement caching for libravatar lookup References: <20200331180336.2999-1-philip@warpmail.net> Date: Sat, 08 Aug 2020 15:03:58 +0200 In-Reply-To: <20200331180336.2999-1-philip@warpmail.net> (Philip K.'s message of "Tue, 31 Mar 2020 20:03:36 +0200") Message-ID: <87a6z51e81.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Philip K writes: > Checking if a domain has an avatar server associated with it requires > at most two (synchronous) DNS queries, at least to ultimately default > to "libravatar.org". Caching the results of domain loo [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40355 Cc: 40355@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Philip K writes: > Checking if a domain has an avatar server associated with it requires > at most two (synchronous) DNS queries, at least to ultimately default > to "libravatar.org". Caching the results of domain lookups reduced the > evaluation time (on my machine) from ~0.3s to an instantaneous > evaluation. > > * lisp/image/gravatar.el (gravatar--service-libravatar): Check if > domain has already been resolved before staring DNS queries > (gravatar-libravatar-cache): New variable. The code has changed a bit (and become asynchronous), but adding caching would be nice. Can you re-spin the patch on top of the current implementation? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 18 10:46:26 2020 Received: (at 40355) by debbugs.gnu.org; 18 Aug 2020 14:46:26 +0000 Received: from localhost ([127.0.0.1]:36605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k82sc-00055T-GF for submit@debbugs.gnu.org; Tue, 18 Aug 2020 10:46:26 -0400 Received: from quimby.gnus.org ([95.216.78.240]:33416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k82sZ-00055D-GQ for 40355@debbugs.gnu.org; Tue, 18 Aug 2020 10:46:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=wd/O879YqeRTsx7ZB4vdA+fCZYrvdQ2dyl+vBtCrFfc=; b=u7aTcGtvqz8QU59GBJcO5FMcRA YUTXG2JmdZ2RJcHGQLEsMrdPclbCM2n8qpZTHHx844eHVZa3xQvbt2Qq8C9uVgi82sDIuB0fdONFc ZYU0QXyRedERxKx2SGI9mXLZ/rxz/cPO6AxPqB+zbB9x3UxjsmSaqzyNHD+7KzB18Td0=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k82sN-0007yz-Ei; Tue, 18 Aug 2020 16:46:17 +0200 From: Lars Ingebrigtsen To: Philip K Subject: Re: bug#40355: [PATCH] Implement caching for libravatar lookup References: <20200331180336.2999-1-philip@warpmail.net> <87a6z51e81.fsf@gnus.org> X-Now-Playing: Cocteau Twins's _The Pink Opaque_: "Hitherto" Date: Tue, 18 Aug 2020 16:46:09 +0200 In-Reply-To: <87a6z51e81.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 08 Aug 2020 15:03:58 +0200") Message-ID: <87y2mcj9la.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > The code has changed a bit (and become asynchronous), but adding caching > would be nice. > > Can you re-spin the patch on top of the current implementation? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40355 Cc: 40355@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > The code has changed a bit (and become asynchronous), but adding caching > would be nice. > > Can you re-spin the patch on top of the current implementation? I've now implemented this in a very different way -- with a general in-memory cache for all types of gravatars. They're pretty small images, anyway. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 18 10:46:31 2020 Received: (at control) by debbugs.gnu.org; 18 Aug 2020 14:46:31 +0000 Received: from localhost ([127.0.0.1]:36608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k82sg-00055k-Mu for submit@debbugs.gnu.org; Tue, 18 Aug 2020 10:46:30 -0400 Received: from quimby.gnus.org ([95.216.78.240]:33430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k82sf-00055M-TU for control@debbugs.gnu.org; Tue, 18 Aug 2020 10:46:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sTsw0PLF6xFA8lpUQaYewA+jbRyPhd6aFsUfPk+0qUs=; b=SK6Wg+7wjUt2VSubjziEWEOAzt Mt17+skeDT6vh6zOjTa+xFThYxOp2Jpw2kO6D8XNlxmt8bdu7ATxISd1cDdg3maFmNOgz9dOX18jc mSB79a5ep9D78Q6hRSJRv6vDg5AvNtRLS8+2lmvsBOAP2apiOsQ9xtSAyYVddNOvW6V0=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k82sY-0007zB-44 for control@debbugs.gnu.org; Tue, 18 Aug 2020 16:46:24 +0200 Date: Tue, 18 Aug 2020 16:46:20 +0200 Message-Id: <87wo1wj9kz.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #40355 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 40355 fixed close 40355 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 40355 fixed close 40355 28.1 quit From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 24 10:09:46 2020 Received: (at 40355) by debbugs.gnu.org; 24 Aug 2020 14:09:46 +0000 Received: from localhost ([127.0.0.1]:58723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kADAQ-0007Jk-70 for submit@debbugs.gnu.org; Mon, 24 Aug 2020 10:09:46 -0400 Received: from mail-wr1-f52.google.com ([209.85.221.52]:33284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kADAN-0007JV-T7 for 40355@debbugs.gnu.org; Mon, 24 Aug 2020 10:09:45 -0400 Received: by mail-wr1-f52.google.com with SMTP id o4so4800001wrn.0 for <40355@debbugs.gnu.org>; Mon, 24 Aug 2020 07:09:43 -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:content-transfer-encoding; bh=JnHlC04KNFunb/NfatUDIFo9MKXECy92eElZWrDbHIA=; b=OQCbahu+zRbr6+Q1NZCCbhxlRCRjDAi8KjJEdk+i84n6p0KPdlch1PgdEDZMqSk5y9 GF4KtgJ2KxsySWkEPpQAJfcxHNt7BviiBaUiYKLLoF90t2hEqd2QCjcxGaJP63A5vCwh +BolaT60EyNweHAg4JqDJ7pMw6xL5U9GI1NcVfGFnwPa1KvCAkNKkfOEWeD8LvIaWVlw 4wXG2R1g+j8tOdIqyu7WntOF+wHDKrNauKLXQsld1qEbjdHNTFckemb5JN50lKcELUkU CpLZ+M98vQ+SmVfqeh6++owyoQVjk19MxiqsVWm68zCno7jDYU6Kx3A2qSRwtwSZvUti IzgQ== 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:content-transfer-encoding; bh=JnHlC04KNFunb/NfatUDIFo9MKXECy92eElZWrDbHIA=; b=uRSAET+dHq+DkjBflghOqHmkvHpmAh65SqYgNsqqAY1C6yho108My0hvy7teeuje3m WJPxhPbDEI8WJyL4BYc8Ja8YU0MrzOM4ESmjNTFkjfZU5okP6CyaCK/hFkCQlsm63Exz AL0raI4p0ey2B7sE+K9+k5RasmcIPTOEED4H3o6f0q9Iug93sZRtn83IwY/KDNMToI3H e4GF3u8BOKduTtf+V6T2dEGCxUpZjLGZzgxuYsYpacrcb+DYu6QfmbUv47bLWyalSzxn D+oZn3k1f+Vsot8jQP+p+4F92bKXbUG5MMuAtkHEWy7cTRdSQcfXPPNSub0q2vYnE4v1 cKbw== X-Gm-Message-State: AOAM532ImMQDc/TcXu8t1aIXgwsTyMwH4jqtuZZvPEutysGzd85fdK2l XfopBWjQnkdvK78yxrgjvVRbtE/sh1E= X-Google-Smtp-Source: ABdhPJy8hKzFeC1swma0cnXR4ZUXkvuSYqui/Mk3lpMzAaFHLBDJe5y5/eN1KJdezXs3MG+zwNEdBQ== X-Received: by 2002:a5d:5551:: with SMTP id g17mr6008036wrw.396.1598278177465; Mon, 24 Aug 2020 07:09:37 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:3d4c:c236:b0a:efb9]) by smtp.gmail.com with ESMTPSA id 128sm25126537wmz.43.2020.08.24.07.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 07:09:35 -0700 (PDT) From: Robert Pluim To: Lars Ingebrigtsen Subject: Re: bug#40355: [PATCH] Implement caching for libravatar lookup References: <20200331180336.2999-1-philip@warpmail.net> <87a6z51e81.fsf@gnus.org> <87y2mcj9la.fsf@gnus.org> Date: Mon, 24 Aug 2020 16:09:34 +0200 In-Reply-To: <87y2mcj9la.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 18 Aug 2020 16:46:09 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40355 Cc: 40355@debbugs.gnu.org, Philip K X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 18 Aug 2020 16:46:09 +0200, Lars Ingebrigtsen said: Lars> Lars Ingebrigtsen writes: >> The code has changed a bit (and become asynchronous), but adding cac= hing >> would be nice. >>=20 >> Can you re-spin the patch on top of the current implementation? Lars> I've now implemented this in a very different way -- with a gener= al Lars> in-memory cache for all types of gravatars. They're pretty small Lars> images, anyway. Doesn=CA=BCt url-retrieve cache on-disk anyway? Robert From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 24 10:13:32 2020 Received: (at 40355) by debbugs.gnu.org; 24 Aug 2020 14:13:33 +0000 Received: from localhost ([127.0.0.1]:58749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kADE4-0007Qa-Oq for submit@debbugs.gnu.org; Mon, 24 Aug 2020 10:13:32 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kADE3-0007QO-VJ for 40355@debbugs.gnu.org; Mon, 24 Aug 2020 10:13:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=I2n3VAXtm6EkTgI8akeZUwpMfETCAktj8l9GZOI+IBY=; b=iOqcw4QgsH01I2Nk63q/NNfTFq VnkgobtRnHI556/VE01Ky50uNTNv2IJMaBhnI1NLtol8rGFZeH93vDFplwKoTyaKyHFP4jUzRcZFB sWliD4hwCZFzEdAUC2+YUPAKUHjuiLSs+E8rziXFpQTu5uxzwOJXcy4PQs+SbHLeKYUw=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kADDv-0007Gu-GM; Mon, 24 Aug 2020 16:13:26 +0200 From: Lars Ingebrigtsen To: Robert Pluim Subject: Re: bug#40355: [PATCH] Implement caching for libravatar lookup References: <20200331180336.2999-1-philip@warpmail.net> <87a6z51e81.fsf@gnus.org> <87y2mcj9la.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEXo2Md/f3DnS2L/ //9XflpNAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+QIGA0KLVM04CkAAAFfSURBVCjPZdKxbsIwEAbg P1ZA1JOpoGo3q4Iq8lOECpZOGZoBpqgTzVMYxFAx8wAGUcm5p+xdEtqhpwz55Pt9jhUgqakA1wQJ yrKmRpAygJrIC9RZEFwQaMEWsAK3A/xWYSSwiQC+BXGb3bZdGDhBjUxw5xLoUHsnGIUOmueoeDwz 3oKSOSQZvAYIXJZA3ZDZHZTP+ZWfjDOMCMWb6zYjGCn/whmE/AtK63287HjrnIc4TQ1nHgQImog/ 4b3ooTljTIfo+GzqKhl6Ds7zikDTJTq+nftZi/2F0Gc0hSjQ1x6aMRS46FtMl4zMWT+QzLhyFB35 OUNNKqJIBAGufPHUw7SI5L9l6LkDVwN1atvcfwwPW+qrwXTR7cZrDSbFx9Ha3SE1/gk4VcNHrFam yBmzKjVmuUqKxRqY58vU5AmKnGEF4yQ1gzVf4qrsixE/byihbF1u2kGbsvt3/vDbVf4ADoOdtQUT 9loAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDgtMjRUMTM6MTA6NDUrMDA6MDAyCdQSAAAAJXRF WHRkYXRlOm1vZGlmeQAyMDIwLTA4LTI0VDEzOjEwOjQ1KzAwOjAwQ1RsrgAAAABJRU5ErkJggg== X-Now-Playing: Various's _Alefa Madagascar_: "Atrefy Andriana - Zaka Tiako Mamolaka Keriko" Date: Mon, 24 Aug 2020 16:13:22 +0200 In-Reply-To: (Robert Pluim's message of "Mon, 24 Aug 2020 16:09:34 +0200") Message-ID: <87wo1o9lod.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Robert Pluim writes: > Doesnʼt url-retrieve cache on-disk anyway? It does if you ask it to, but I thought it was simpler to just do a general cache -- that way we didn't need two levels of caches. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40355 Cc: 40355@debbugs.gnu.org, Philip K X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Pluim writes: > Doesn=CA=BCt url-retrieve cache on-disk anyway? It does if you ask it to, but I thought it was simpler to just do a general cache -- that way we didn't need two levels of caches. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Jun 22 17:14:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 22 Sep 2020 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator