-
Notifications
You must be signed in to change notification settings - Fork 39
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
Optimize Lint/UselessAssign
#603
Comments
Parser file: $ time ameba --silent ../crystal/src/compiler/crystal/syntax/parser.cr
ameba --silent ../crystal/src/compiler/crystal/syntax/parser.cr 1.01s user 0.02s system 99% cpu 1.041 total
$ time ameba --silent ../crystal/src/compiler/crystal/syntax/parser.cr --except "Lint/UselessAssign"
ameba --silent ../crystal/src/compiler/crystal/syntax/parser.cr --except 0.09s user 0.03s system 128% cpu 0.095 total Crystal compiler + stdlib: $ time ameba --silent
ameba --silent 15.85s user 1.26s system 198% cpu 8.640 total
$ time ameba --silent --except "Lint/UselessAssign"
ameba --silent --except "Lint/UselessAssign" 8.32s user 1.14s system 154% cpu 6.117 total |
Interestingly, looking at perf across the entire Crystal stdlib + compiler, it's possible perf stats
|
Same for ameba itself:
|
|
Doing some basic performance metrics running ameba over the Crystal stdlib parser (
src/compiler/crystal/syntax/parser.cr
), most rules take a fraction of a second to run, exceptLint/UselessAssign
, which takes almost a second. Disabling this rule results in a significant boost in ameba performance (on this file). Granted, this isn't a great benchmark, esp since not all rules are in their worst-case performance wise, I think it's worth looking into if this rule can be optimized.perf stats
Benchmark diff
The text was updated successfully, but these errors were encountered: