Subject: Re: bug#58302: 29.0.50; browse-url-emacs is extremely slow (and I think always has been?)

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 12 Oct 2022 13:03:59 +0200

Phil Sainty <[email-masked]> writes:

> I'm not very familiar with the ins and outs of these code paths,
> but my first impression is that we've initiated an operation which
> needs to deal with a particular URL and if we were to make a high-
> level binding to indicate that we were doing this, we could then
> cache and re-use the results of those network requests for the
> extent of that binding.

[excellent analysis elided]

I think the conclusion here is that using the file-name-handler-alist
stuff for this is the absolutely pessimal way to implement
`browse-url-emacs'.

It should be pretty easy to rewrite browse-url-emacs to just call
`url-retrieve-synchronously' explicitly, and then display the resulting
data -- and it should be much, much faster.