-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Compare parameters by object value rather than string representation (Related to #2838) #2887
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
base: master
Are you sure you want to change the base?
Conversation
|
The failing exporter checks seem to be because I changed the schema of the logical group keys, is there a way I could update what verify is expecting? E.g. verify expects |
|
I guess I could have logical groups have a key for grouping and a display name for errors, but I feel this would just add unnecessary nonfunctional code |
|
You can just update the verified files. |
Won't this not affect the CI though? |
I don't understand the question. The test compares the output of the run to the verified file. |
Sorry, didn't realize that the GitHub actions pulled tests from my PR and not master. Will implement these changes. |
…n lengths are different
|
This effectively closes #2838 because it correctly groups parameters into different groups based on value. However, since the example in #2838 passes randomly generated parameters will improper seeding, the ratios won't come out as desired. If the parameters are properly seeded to be deterministic and effectively constant across calls of the ArgumentsSource, then the desired behavior will be exhibited. With super large arrays like the ones in #2838, though, the report generation takes a few minutes (I think its because of a lot of repeated value comparison work when sorting for the summary table) |
That's likely due to the boxing of every element. Perhaps it can be accelerated by using Btw, apparently md arrays throw from |
This is related to issue #2838 and PR #2886
Previous Behavior
Parameters and arguments passed to benchmarks were grouped into logical groups based on
ParameterInstances.ValueInfo(a string representation), which failed for types like arrays (whose string representations just contain length and element type), (partially) causing #2838. Any type where objects are not equal but can have the sameToString()was affected by this behavior.New Behavior
When using
DefaultOrdererto group benchmark cases, parameters are compared by their actual value as opposed to their string representations, leading to correct benchmark case grouping. This is done throughParameterEqualityComparer, so any parameter or custom wrapping struct for a parameter overridingobject.Equalswill now be properly distinguished regardless of itsToStringoverride. For anyIEnumerables (both non-generic and generic), there is now built-in functionality inParameterComparerwhich compares enumerables element-by-element for value-based equality.