unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: philip@warpmail.net (Philip K.)
To: Robert Pluim <rpluim@gmail.com>
Cc: 40355@debbugs.gnu.org
Subject: bug#40355: [PATCH] Implement caching for libravatar lookup
Date: Tue, 31 Mar 2020 23:30:23 +0200	[thread overview]
Message-ID: <87d08sp5zk.fsf@bulbul> (raw)
In-Reply-To: <m24ku41ekm.fsf@gmail.com> (message from Robert Pluim on Tue, 31 Mar 2020 21:58:49 +0200)

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Tue, 31 Mar 2020 20:03:36 +0200, Philip K <philip@warpmail.net> 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.





  reply	other threads:[~2020-03-31 21:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 18:03 bug#40355: [PATCH] Implement caching for libravatar lookup Philip K
2020-03-31 19:58 ` Robert Pluim
2020-03-31 21:30   ` Philip K. [this message]
2020-04-01  7:27     ` Robert Pluim
2020-04-01 10:34       ` Philip K.
2020-08-08 13:03 ` Lars Ingebrigtsen
2020-08-18 14:46   ` Lars Ingebrigtsen
2020-08-24 14:09     ` Robert Pluim
2020-08-24 14:13       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d08sp5zk.fsf@bulbul \
    --to=philip@warpmail.net \
    --cc=40355@debbugs.gnu.org \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).