-
Notifications
You must be signed in to change notification settings - Fork 344
Slices: Small code quality regression #975
Comments
The previous approach did bring the exception construction and throw machinery into the method so regardless of hot/cold code its a much heavier inlined method. Could /cc @mikedn @AndyAyersMS |
No, the exception construction code was located in the cold area and that allows some optimizations. |
If we believe this is an issue worth fixing, we could ship three spans in the package: fast span for new coreclr, slow-span for old corclr, and slow-span' for clr. |
From what I understand the jit changes discussed here are going to show up in desktop CLR in 4.6.3 (at least for x64). I doubt the "bad" block placement makes enough of a perf difference to justify complicating the source code. While it certainly looks better to move cold code to the end of the method the cycle benefits are typically small. |
@omariom, is this issue still of concern? |
No |
Uh oh!
There was an error while loading. Please reload this page.
@KrzysztofCwalina @jkotas @adamsitnik @atsushikan
Contract's methods where changed recently from throwing to calling ThrowHelper's methods.
The older JITs don't recognize those throw helpers as never return methods and keep the call in the hot area. That affects the portable Span.
This is how
RequiresInRange
looked before the change:Now it does this:
This method compiled on .NET Framework 4.6.1..
generates the following code:
The text was updated successfully, but these errors were encountered: