Subject: Re: bug#63871: 29.0.91; JIT native comp triggered to compile loaddefs repeatedly on require

From: Eli Zaretskii <[email-masked]>
Date: Sat, 03 Jun 2023 18:05:20 +0300

> Date: Sat, 3 Jun 2023 15:50:37 +0100
> From: Jimmy Wong <[email-masked]>
> Cc: [email-masked]
> 
> Thanks. I ended up advising get-buffer-create instead as I don’t know how to add a hook to
> buffer-list-update-hook and not run into an infinite loop.

My suggestion would be to add this function to
desktop-after-read-hook.  Did you try that?