kanaka / mal

mal - Make a Lisp
Other
10.11k stars 2.57k forks source link

rpython: simplify and probably remove a performance bottleneck #698

Closed asarhaddon closed 1 month ago

asarhaddon commented 1 month ago

Traverse environments without recursion. Unwrap the key once. Do not wrap DEBUG-EVAL on each evaluation. Spare two intermediate MalLists for the 'do' special form.

kanaka commented 1 month ago

Looks good. I've merged them.

Here are some quick tests on my local machine:

Current Java implementation is 274,000 iters/sec on this machine.

It's definitely a notable improvement. I don't know why commenting out that single conditional makes such a big change. rpython's optimizations are amazing (and SLOW to perform) but also sometimes opaque in why little things can make such a big difference (at least they are to me).