Adds benchmark tests for ReadOnlySequence<T>.FirstSpan #410
Adds benchmark tests for ReadOnlySequence<T>.FirstSpan #410billwert merged 5 commits intodotnet:masterfrom
Conversation
|
I didn't leave a comment on each instance of the new underscores. They should all be fixed. Thanks! |
8bdd1fc to
49e8415
Compare
| [Benchmark(OperationsPerInvoke = 16)] | ||
| public int FirstArray() => First(new ReadOnlySequence<T>(_array)); | ||
|
|
||
| #if NETCOREAPP3_0 |
There was a problem hiding this comment.
good question. I don't think we have a solid plan yet. (And this approach is fragile, of course.) @adamsitnik may have considered this - let's see what he says when he's back from vacation.
There was a problem hiding this comment.
@ahsonkhan it depends. if it's a single method or just a few like here, you can use #if TFM. If it's an entire type, you should exclude it per certain TFM in the .csproj file
performance/src/benchmarks/micro/MicroBenchmarks.csproj
Lines 60 to 61 in eaec460
There was a problem hiding this comment.
Sure, I figured that would be the expected approach. That's what I ended up doing for the recent JsonWriter perf tests. Thanks for clarifying.
Adds benchmark tests for ReadOnlySequence.FirstSpan covering all cases
Related to https://github.com/dotnet/corefx/issues/33029
cc: @adamsitnik @ahsonkhan