-
-
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
Added compile progress tracker #4182
Conversation
just tested, this is nice, but in release mode longest is: |
It is great feature, however I would like to disable it by default because the compiler is quiet a long time ago. For instance, |
I think this should be enable on |
Oooh, nice! |
@asterite Would you consider adding a progress tracker to crystal? If so, when should it be displayed? |
@RX14 It does look right, but usually compilers and command line tools don't emit progress output unless requested. I think the compiler should be faster so that a progress bar is not needed. |
@asterite I'll change it to default to progress off. Regarding neccesity, I doubt LLVM is going to get 10x faster, and LLVM makes up >50% of compile times for new builds (more for release, but progress tracking isn't useful there). While progress hopefully won't be necessary for incremental builds, it will be neccesary for initial builds I think. Regardless, this PR cleans up the statistics code a bit, and I don't think a progress indicator can be harmful. |
src/compiler/crystal/command.cr
Outdated
@@ -480,8 +478,8 @@ class Crystal::Command | |||
opts.on("-s", "--stats", "Enable statistics output") do | |||
compiler.progress_tracker.stats = true | |||
end | |||
opts.on("--no-progress", "Disable progress output") do | |||
compiler.progress_tracker.progress = false | |||
opts.on("-p", "--progress", "Enable progress output") do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other crystal command using -p
is crystal play
(for port), which doesn't take compiler options, so this is safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this PR so that progress is off by default, and added a progress option to the makefile.
Looks like a weird failure from osx. |
Would have been nice to have this in 0.22.0, is there anything left to do? |
Bump again :/ |
@RX14 Nice work :) |
@RX14 sorry for the delay with this. I think most of us simply assumed this opinion was enough feedback: Personally, I don't see any benefit to running with |
@mverzilli Overall, |
I get the differences but still, if you want to see progress while compiling, Maybe we could add the total number of stages before completion to Anyway, just my opinion! |
@mverzilli |
Make that nine hearts!! Personally, I would love this feature. +1000000000 from me! |
I'd simply say that And WDYT? |
A lot of good arguments for this feature have been already covered, but I just want to point out that it's an easy feature to remove (it has no API surface) if for whatever reason it turns out to be a bad idea. |
Given all the thumbs up for the feature, and since it is not enabled by default, and, as RX14 points out, it is easy to remove should it cause any troubles, I say we merge. |
@RX14 This broke the current stats. Previously it would show, for example, "Codegen (crystal)" and then after some time print the time. This was useful to know in which stage the compiler were. But right now that's lost (it's printed all at once). Could you please fix it? :-) |
This PR adds a compile progress indicator to crystal. A new
ProgressTracker
class has been added which controls both stats and progress options. This is WIP, as there are a few things left to figure out such as the current assumption of the number of compiler stages run.Demo: