On Sat, Jul 06 2024, Eli Zaretskii wrote: >> What else could cause it in ert-test-run-tests-batch-expensive? > > I don't know, and I don't see why we should guess. Run that under a > debugger with a breakpoint in balance_an_interval that shows the > backtrace, and you will see the answer very quickly. Here are the flame graphs; recorded with perf record -g -o ../src/emacs -Q --batch -f igc--collect \ -l lisp/emacs-lisp/ert-tests.el --eval \ '(ert-run-tests-batch-and-exit "ert-test-\\(parse\\|plist\\|record\\|run-tests-batch-exp\\)")' Both the MPS and non-MPS version compiled with -g -O2 -fno-omit-frame-pointer. I don't see the anything very quickly.