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: Fri, 07 Oct 2022 13:48:35 +0200

Phil Sainty <[email-masked]> writes:

>> coming
>> from the error message (which is a misleading error message).  There's
>> probably a "sleep-for 2" after displaying the error message?
>> There's a bug report in debbugs somewhere about fixing the error
>> message, but I can't find it now.
>
> Perhaps https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42431 ?

Yes, that's the one I was thinking about, and it was apparently fixed at
the time?  But this looks like pretty much the same problem, but with a
different code path...

Phil Sainty <[email-masked]> writes:

> True, `after-find-file' does this:
>
>  (or not-serious (sit-for 1 t))
>
> And indeed that accounts for 1s of the ~2.5s delay; so this is
> a significant factor, yet seemingly not the only issue.
>
> With that commented out I now get:
>
> Elapsed time: 0.835925s (0.039518s in 1 GCs) ;; find-file-noselect-1
> (1.7317769889999999 1 0.03951770099999996)   ;; the overall
> benchmark-run
>
> Instead of the former:
>
> Elapsed time: 1.876737s (0.057295s in 1 GCs) ;; find-file-noselect-1
> (2.680159853 1 0.057295379000000146)         ;; the overall
> benchmark-run

Perhaps there's something else that also wants to sleep a bit after a
file error...  In any case, I think the real fix is to not signal an
error here, because that's wrong.

I haven't looked at this code in a while, though.