Subject: Re: bug#62975: 29.0.90; Forking processes on macOS has become very slow in Emacs 29

From: Daniel Martín <[email-masked]>
Date: Tue, 25 Apr 2023 17:59:19 +0200

"M. Ian Graham" <[email-masked]> writes:

>> Can someone else who uses Emacs 29 on macOS reproduce this regression
>> in performance relative to Emacs 28?
>
> I've observed the same general trend at the same general time but had trouble getting a clear handle on the difference.
>
> Vague personal observations: I've noticed slowdown on macos (x86) but not linux in recent months, but in addition to moving emacs versions from v28 to master to v29 I've also changed installation methods from homebrew to nix+home-manager so that's a massive confounder.
>
> Large loads of things like my org config, elfeed or magit seem sluggish now (often multiple seconds) where they were snappy before (sub-second), and my impression has been that either forking or I/O is much slower but I haven't done much narrowing. I'm unsure at present whether my own observations are due to emacs versions or nix/build/installation differences.
>
> On magit specifically, I've followed the magit manual's advice re: the magit executable affecting perf (https://magit.vc/manual/magit/MacOS-Performance.html) but not seen significant changes there.
>
> I just attempted to reproduce some difference via emacs -Q and a simple recipe, but haven't easily been able to see a signal. Below are my results for v28 vs v29, both installed via nix. I'm also slowly trying other installation methods with the same recipe to see if anything jumps out.
>
> So far, v28 feels plenty slow too.
>
> John: Any advice on recipe or setting changes that might get me closer to your results, or should I be seeing something as is? 
>
> Cheers,
> Ian
>
>
> --- Timing summary ---
>
> Emacs 28: Refreshing buffer ‘magit: emacs’...done (1.880s)
> Emacs 29: Refreshing buffer ‘magit: emacs’...done (1.910s)
>

These results are pretty much similar.  If the performance degradation
is something you notice but can't reproduce in a benchmark, I'd
recommend using the macOS Instruments tool to capture a performance
trace of Emacs 28 vs 29, while doing the same operations (magit or
elfeed refresh, for example).

A performance trace from Instruments would help us assess, at the OS and
C level, if the slowdown you perceive is real, and where the bottleneck
may be.

Let me know if you are not very familiar with Instruments and I'll
instruct you how to capture a performance trace of Emacs with it.