-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Revert "Improve Span.Reverse fast path performance" #78605
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
Conversation
This reverts commit 6ddd06c.
|
Tagging subscribers to this area: @dotnet/area-system-memory Issue DetailsReverts #70944
|
jkotas
left a comment
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.
Are you able to reproduce the regression as well? (I just want to make sure this is not something that only reproduces for me before we revert it.)
Yes. using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System;
using System.Linq;
public partial class Program
{
static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
private byte[] _values = new byte[33];
[Benchmark]
public void Reverse() => _values.AsSpan().Reverse();
}
And then after reverting:
|
|
@jkotas thank you for reporting the regression. @stephentoub @jkotas may I ask why you have decided to revert #70944 so quickly? I am not happy about this for multiple reasons:
|
|
It's the same thing we'd do if a PR introduced a repeatable CI failure, a behavioral regression, etc: back out the change as quickly as possible to get things back to a known state, and then enable the relevant parties to try again without time pressure. |
I understand such approach when the CI is red, or we are regressing an IMPORTANT scenario. From my perspective you have caused a lot more work for me:
If I was given the time to react, I would just send a small PR with a fix for the bytes code path. It would take me half an hour including running the benchmarks. |
|
Then you can revert the revert locally, without re-reviewing it, make the change as a commit on top of that, it won't take you any more time, it won't conflict, etc., and in the meantime we haven't incurred a perf regression that other things (like the very PR you're worried about conflicting) then layer on top of, compounding the problems and making it harder to understand / investigate, causing noise and work for all the folks that manage interactions with the performance reporting system, etc. |
|
I could do that, but the contributor who contributed the PR has already started working on the fix: #70944 (comment) |
That was a day ago, and you stated it would take you "half an hour including running the benchmarks". If you really believe you would have a new PR up in 30 minutes from now, and it'll overall save you a lot of time, I suggest you do so, with thanks to @yesmey for their efforts. If you don't want to do that, it still shouldn't take you a lot of time, as you can diff the previous commit with the new one and only review the difference, resulting in little additional work, and still minimal impact on the other PR you're concerned about. |
)" (dotnet#78605)" This reverts commit de005e5.
|
Didn't have time yesterday and I just got back from work :) Running the benchmarks now |
There would be no noise as we were missing coverage for this code path. PTAL at dotnet/performance#2748 |
There are multiple uses of Array.Reverse and MemoryExtensions.Reverse throughout the codebase, including for bytes. |
Reverts #70944
Fixes #78604
cc: @jkotas, @adamsitnik