New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance 40x slower for comprehension operation in IEx #5073
Comments
In IEx code is evaluated and not compiled, so it is expected. Never benchmark outside of a compiled module. |
@josevalim Thanks for the explanation! I fount it in the IEx doc. But isn't that |
.exs is also compiled but the bytecode modules is not written to disk (only loaded in memory). |
Awesome! I was under impression that
|
Please submit an errata because that's not correct. :) On Thursday, July 28, 2016, sunboshan notifications@github.com wrote:
José Valimwww.plataformatec.com.br |
To clarify; Elixir does not care about the file ending, Elixir will do the same thing regardless if the file ends in |
My opinion is that should be clearly explained in docs, as I saw few On Jul 28, 2016 8:36 PM, "Eric Meadows-Jönsson" notifications@github.com
|
@k-solutions We are also in the opinion that things should be explained in documentation. It's currently documented here: http://elixir-lang.org/getting-started/modules.html#scripted-mode, it's also the first result when I google "elixir exs". If you think the documentation can be improved a PR would be very appreciated. External contributions are always appreciated for documentation since the core developers usually already know the subject and are, hence, not as good at knowing what is difficult or hard to find. Benchmarking from iex is not necessarily bad if you make sure to call compiled code. |
@ericmj Thanks for above link. However in that doc, it is said
Per discussion with @josevalim above, |
While docs are correct I can see how they are confusing. "Without the need for compilation" means that they don't need to be compiled but there can still be compiled elements in them. An A PR would be very appreciated. |
Environment
Mac OSX 10.11
Here's a piece of code computing
pythagorean triples
using comprehension.Run it
Exact same piece of code in IEx
It's 40x slower than running through an .exs file. Not sure if it's a bug in
IEx
or it's expected to be slower inIEx
. Any thoughts?The text was updated successfully, but these errors were encountered: