You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#36 at least to some extent!
Throwing a non-`Error` subclass makes the Fibonacci benchmark ~6x
faster:
-Time elapsed (ms): 60459
+Time elapsed (ms): 10152
The difference for the 40th Fibonacci number is even more dramatic,
~2000s → 200s. Still slower than jlox's 27 seconds, but at least within
an order of magnitude.
Thanks to https://github.com/davidhfriedman/jslox for the inspiration.
Bug Report Checklist
main
branch of the repository.Expected
Tree-walk interpreters are expected to be slow.
Actual
Mine is quite slow! jlox takes ~27s to evaluate
fib(40)
on my machine whereas gravlax takes ~34 minutes.Most JS implementations are pretty slow. The only one I've found that's meaningfully faster is https://github.com/davidhfriedman/jslox
Additional Info
No response
The text was updated successfully, but these errors were encountered: