-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add benchmark for source-generated SetBinding #25
Add benchmark for source-generated SetBinding #25
Conversation
simonrozsival
commented
Apr 22, 2024
•
edited
Loading
edited
Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated |
---|---|---|---|---|---|---|
TypedBindName | 13.11 us | 0.244 us | 0.251 us | 1.2207 | 0.6104 | 7.5 KB |
SourceGeneratedBindName | 14.39 us | 0.137 us | 0.129 us | 1.3580 | 0.6714 | 8.36 KB |
BindName | 16.98 us | 0.315 us | 0.279 us | 1.6785 | 0.8240 | 10.31 KB |
TypedBindChild | 20.47 us | 0.214 us | 0.190 us | 2.0142 | 1.0071 | 12.42 KB |
SourceGeneratedBindChild | 21.09 us | 0.374 us | 0.349 us | 2.1667 | 1.0681 | 13.28 KB |
BindChild | 21.51 us | 0.284 us | 0.266 us | 2.5940 | 1.2817 | 16.02 KB |
TypedBindChildIndexer | 21.78 us | 0.361 us | 0.338 us | 2.3193 | 1.1597 | 14.38 KB |
SourceGeneratedBindChildIndexer | 22.46 us | 0.264 us | 0.247 us | 2.4719 | 1.2207 | 15.23 KB |
BindChildIndexer | 41.00 us | 0.459 us | 0.429 us | 4.1504 | 2.0752 | 25.55 KB |
Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines. |
Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines. |
@@ -56,7 +56,7 @@ public static DiagnosticInfo SuboptimalSetBindingOverload(Location location) | |||
title: "SetBinding with string path", | |||
messageFormat: "TODO: consider using SetBinding overload with a lambda getter", | |||
category: "Usage", | |||
defaultSeverity: DiagnosticSeverity.Warning, | |||
isEnabledByDefault: true), | |||
defaultSeverity: DiagnosticSeverity.Hidden, |
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 would like to keep some ""diagnostic"" even if we do not show it to the user. Currently it will be reported as hidden, we can introduce an explicit list of diagnostic we do not report and filter out before reporting ,if this is not enough.
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.
Will this still be shown in the CLI output or in VS/VSCode?
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 tried running the sample app with different overload, did not see any warnings/errors. When passing func it shows correct error.
{ | ||
return new EquatableArray<DiagnosticInfo>([DiagnosticsFactory.SuboptimalSetBindingOverload(invocation.GetLocation())]); | ||
} | ||
var secondArgument = argumentList[1].Expression; |
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 see that we do the validation of the number of arguments in IsSetBindingMethod
but it's still making me a little uneasy to just reach for an index without a check for the length of the array in the same scope. This could break if somebody refactors this code later. I'd just add ArgumentOutOfRangeException.ThrowIfLessThan(argumentList, 2);
Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines. |