Subject: bug#77299: eww-auto-rename-buffer 'title interaction with eww-readable-urls

From: Jim Porter <[email-masked]>
Date: Tue, 17 Jun 2025 16:54:12 -0700

On 6/17/2025 9:33 AM, Jim Porter wrote:
> As a bonus, this implementation is about 4x faster than the old one, 
> since it does all the work in a single pass over the DOM. For large 
> pages, simply computing the readable DOM can take a while; doing it for 
> the Wikipedia page for "Sun" takes a full second. Here are the stats 
> from calling the relevant code before and after (sum of 20 iterations):
> 
>    BEFORE:  20.635833s (15.510534s in 270 GCs)
>    AFTER:    4.320405s (3.041672s in 55 GCs)
> 
> We could probably make this even faster by doing something more 
> efficient than '(length (split-string FOO))', but one thing at a time. 
> That's how the code was before, so I didn't change that bit.

I poked around at this and managed to get it down to 0.54s (still the 
sum of 20 runs), so it's now 38x faster. I'll work on cleaning this up 
into a real patch and submit it as a separate bug, since that's a pretty 
significant improvement.