-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Span: BinarySearch add Array baseline perf tests and remove TODO comments #25989
Conversation
Very nice results! The PR looks good. |
@@ -821,12 +821,6 @@ public static bool Overlaps<T>(this ReadOnlySpan<T> first, ReadOnlySpan<T> secon | |||
/// <exception cref="T:System.ArgumentNullException"> | |||
/// <paramref name = "value" /> is <see langword="null"/> . |
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.
Do we throw when value is null or when comparer is null (or both)?
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.
only the comparer I think since the comparer could be handling searching for null values. So it is a mistake in the comment here.
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.
otherwise, lgtm. tyvm!
@ahsonkhan fixed the xml comment, good catch :) A question, are these comments even used, most of the methods only have a summary, so wasn't sure what the convention was? |
@nietras, can you please resolve the merge conflict?
The xml comments can be observed from VS IntelliSense as far as I can know, |
@ahsonkhan merged and resolved conflict. |
@ahsonkhan I have a follow up question, a bit off topic. Is there any way to run specific performance tests and not all performance tests using the |
@nietras, yes. See https://github.com/dotnet/corefxlab/blob/master/scripts/PerfHarness/run.bat. The perf:typenames parameter. |
@KrzysztofCwalina thanks I'll have to see how this relates to the |
corefx uses build0007 of xunit.performance (from May) while corefxlab uses a newer version: I think build0007 has support for that option, so it should work (was introduced around build0003 I believe). Otherwise, as a workaround, you could comment out parts of the following while running perf tests locally: cc @jorive |
@ahsonkhan how would I pass the |
@ahsonkhan have you tried running this command: |
Yes, @jorive, that is what I do when I want to run all the System.Memory performance tests only.
I am assuming that @nietras was looking for higher granularity, i.e. run specific subset of tests from the set of System.Memory perf tests. @nietras, please clarify if that was your intention.
In corefxlab, we run it using the PerfHarness and dotnet cli (not msbuild) as described here: |
@ahsonkhan @jorive exactly! So for example run just the tests for
Ok, so it is not possible using |
Share between CoreCLR and Mono Mono began using a copy of these methods with mono/mono#15946 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
…ents (dotnet/corefx#25989) * Add baseline Array BinarySearch perf tests, remove TODO comments. * cleanup more TODOs * fix xml comment Commit migrated from dotnet/corefx@ae860b8
Some leftover work from #25777
Added BinarySearch perf tests using
Array.BinarySearch
for comparison as suggested by @ahsonkhan CC: @KrzysztofCwalinaFrom this it can be seen there are significant performance improvements when compare is fast i.e. for
int
, this is due to the improvements in the actual binary search code for Span.