-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Question] Compiler Performance #4156
Comments
There is no way on earth Rust compiled a freaking release binary faster than the debug one. Does Rust cache any object files or LLVM IR? |
Also, only Java has a 90-byte hello world program... |
I would suggest to check the llvm version you are using. That might affect the results. Also, |
You'll want to use This stdlib overhead probably doesn't scale as much with the project. In fact compiling the crystal compiler in debug mode (with no cache) takes only 37 seconds, while compiling hello world takes 0.6s. That's only 62 times slower to build the entire compiler than to build a single hello world, and I can tell you the compiler's a lot more than 62 times larger than hello world. |
@kirbyfan64 @bcardiff I'll check that out, thank you! |
Crystal tells LLVM to optimize with |
With regards to the discrepancies in compile times, did you take only one measurement or did you average several? The latter would help average out inconsistencies due to CPU load and disk usage. |
|
The compiler is known to be slow in release mode, mostly because of LLVM optimizations, but also because we aren't doing yet incremental compilation. This is planned, so there's nothing we can do at the moment. |
Thanks everyone for answering my question, keep up the good work! 🥇 👍 |
I noticed incremental compilation was mentioned above on Mar 23, 2017, and today in June 2020 it's still on the roadmap. Any idea in which future time frame it's going to come? |
Hello everyone,
I'm opening this issue because I wanted to know more about Crystal's compiler: I've noticed when I run some tests (check here for more info) that Crystal has the worst "release" compiler.
Below you can find a mini table on what I run my test with. Crystal took 2.248 s to compile and optimize a simple
puts "Hello world"
.Is that normal?
If you have some suggestions, please let me know.
You can find any related info like Crystal's version and the source here.
The text was updated successfully, but these errors were encountered: