-
Notifications
You must be signed in to change notification settings - Fork 166
Conversation
FYI @alexeieleusis : even with the best of, it looks like |
What time is it taking? |
144 ms (from here) |
I'll look into it once this is merged, at least we have a baseline now. |
bin/linter.dart
Outdated
@@ -54,6 +55,8 @@ void runLinter(List<String> args, LinterOptions initialLintOptions) { | |||
abbr: "h", negatable: false, help: "Show usage information.") | |||
..addFlag("stats", | |||
abbr: "s", negatable: false, help: "Show lint statistics.") | |||
..addFlag("benchmark", |
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.
may not need a shorthand for this flag, given how rarely it'll be used?
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.
Sounds good.
bin/linter.dart
Outdated
@@ -141,21 +144,27 @@ void runLinter(List<String> args, LinterOptions initialLintOptions) { | |||
} | |||
|
|||
var stats = options['stats']; | |||
if (stats == true) { | |||
var benchmark = options['benchmark']; | |||
if (stats == true || benchmark == true) { |
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.
perhaps (stats || benchmark)
?
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.
Yes! For some reason I thought I convinced myself that undefined would return null
but yeah, much better. 👍
@@ -291,6 +266,57 @@ class SimpleFormatter implements ReportFormatter { | |||
} | |||
} | |||
|
|||
writeBenchmarks(IOSink out, List<File> filesToLint, LinterOptions lintOptions) { |
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.
so few return types :(
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.
Yep. Consider this bit of code my last stand against gratuitous returns (in non API bits). 😸
tool/travis.sh
Outdated
# Run linter with all lints enabled. | ||
dart bin/linter.dart -s -q -c example/all.yaml . | ||
# Benchmark linter with all lints enabled. | ||
dart bin/linter.dart -b -q -c example/all.yaml . |
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.
--benchmark
if you remove the shorthand
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.
Done.
@devoncarew : take another gander? |
lgtm! |
Thanks! |
New benchmark mode that prints lint stats based on the best of 10 runs.
Follow-up from: dart-lang/sdk#57574
@devoncarew @bwilkerson