dholm / benchmark-init-el

Benchmark your Emacs initialization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: (error "Lisp nesting exceeds `max-lisp-eval-depth'")

stardiviner opened this issue · comments

Hi @stardiviner, did you receive this error during startup or when running benchmark-init/show-durations-(tree|tabulated)?
Which emacs version are you using?
If you start emacs with the flag --debug-init do you get a backtrace?

I get a version of this which says "variable binding depth exceeds max-specpdl-size." It occurs for both tree and tabulated. I am running Emacs 25.0.5 with a relatively large package configuration. I get no backtrace with --debug-init, only a transient message, this in the messages buffer:

benchmark-init/node-foldr: Variable binding depth exceeds max-specpdl-size

I got the same on 24.4.1 (also with big package tree, mostly loaded via use-package)

And in my Messages I found:
benchmark-init/node-foldr: Variable binding depth exceeds max-specpdl-size

Above shows healthy startup and then 342 calls to benchmark-init/node-foldr. Those are not identical (every have different params), so looks like there are too many args for too deep recurencing calls…

I also tried (after startup but before calling benchmark-init/show-duration-tree)

M-x set-variable max-specpdl-size 200000

and benchmark-init nicely showed its results

So, to summarize:

  • to workaround
 (setq max-specpdl-size 200000)

(or some other big number) or set this variable manually before asking for benchmark-init report

  • to resolve, likely node-foldr should be rewritten somehow (manual iteration instead of recurence?) as now it seems to explode too deep for default emacs settings in bigger library trees

@Mekk Thank you for the in-depth analysis. I am planning to rewrite that part of the code to avoid recursion which should resolve this issue.

@stardiviner @miabrahams @Mekk Fix pushed to master. Let me know if you still have issues.

Same here.

Backtrace: https://pastebin.com/raw/VXzYRtpS

  • macOS 10.12.6
  • Emacs 28.0
  • benchmark-init 7a0f263