Skip to content

Use evaluation when compiling modules#15087

Open
josevalim wants to merge 1 commit intomainfrom
jv-module-eval
Open

Use evaluation when compiling modules#15087
josevalim wants to merge 1 commit intomainfrom
jv-module-eval

Conversation

@josevalim
Copy link
Member

@josevalim josevalim commented Jan 31, 2026

This explores a different approach to execute module definitions that uses the evaluator (interpreted) rather than the compiler (compiled). I have tried this a long time ago but it was never faster, but I assume a combination of the JIT and different optimizations have made it viable.

Early experiments are very promising. This mode is 5x faster for Remote's codebase compared to 1.19 and 3x faster than main (which already has other improvements:

Version Elixir Version Elixir Commit Total Time vs Baseline
Baseline 1.19.4-otp-27 N/A 7:47.95 (467.95s) -
Main 1.20.0-rc.1 426a429 4:57.91 (297.91s) 36.3% faster
This branch 1.20.0-rc.1 732e701 1:25.08 (85.08s) 81.8% faster

The next steps is to expose this as an option and do some additional testing to verify stacktraces are solid. Note this does not change the generated artefact in any way. Each function in the module is still compiled and optimized within the generated .beam file.

@josevalim
Copy link
Member Author

I sent a PR for documentation purposes. I'm not planning to merge it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant