You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also saw that we are eliminating redundant test instruction done in #38586.
Below is the baseline and test output I produced by locally building clrjit.dll for baseline and test and running benchmarks with below environment variables:
@DrewScoggins thanks for making sure the diff link is against the runtime repo. However this still produces a unicorn as it covers July 14-July 21. From eyeballing the graph, shouldn't the SHA's be about July 14-July 15?
(I realize that viewing even the tightly bracketed diff in Github is often not going to be feasible, but having well bracketed SHA's to examine offline is certainly important.)
Yes, getting a tight bracket is very important, and it is something that we are thinking about how to solve in a consistent, accurate, and automated fashion. In the meantime, we believed that having a link that can at least bracket to the time of the report, in this case a week, was still useful as a starting point. For what it is worth, when I clicked the link I was able to get the comparison and didn't see an error, although I have had that happen plenty of times.
For now what we will do is when a bug is copied over we will use the tools in the generated report to try and tighten the window as best we can for the diff link. It might not be perfect, but hopefully will be a start.
@DrewScoggins makes sense. Sounds good. I hope it didn't appear as a criticism. I see this as an iterative process to make these as useful as possible.
; System.Memory.Span`1[[System.Char, System.Private.CoreLib]].IndexOfValue()subrsp,28movrdx,[rcx+18]testrdx,rdxjne short M00_L00xorr8d,r8dxoreax,eaxjmp short M00_L01M00_L00:lear8,[rdx+10]moveax,[rdx+8]M00_L01:movzxecx,word ptr [rcx+2C]mov[rsp+24],ecxmovedx,[rsp+24]movrcx,r8movr8d,eaxcall System.SpanHelpers.IndexOf(Char ByRef, Char, Int32)nopaddrsp,28ret; Total bytes of code 56
; System.SpanHelpers.IndexOf(Char ByRef, Char, Int32)pushrsivzeroupperxorr9d,r9dmovsxdr10,r8dmovrax,r10movr11,rcxtestr11b,1jne short M01_L01cmpr8d,10jl short M01_L01movrax,rcxnegeaxmovr8d,eaxshrr8d,1Faddeax,r8dsareax,1moveax,eaxandrax,7cmprax,4jl short M01_L02M01_L00:lear8,[rcx+r9*2]movzxr11d,dxmovzxesi,word ptr [r8]cmpr11d,esije near ptr M01_L16movzxesi,word ptr [r8+2]cmpr11d,esije near ptr M01_L15movzxesi,word ptr [r8+4]cmpr11d,esije near ptr M01_L14movzxr8d,word ptr [r8+6]cmpr11d,r8dje near ptr M01_L13addr9,4addrax,0FFFFFFFFFFFFFFFCM01_L01:cmprax,4jge short M01_L00M01_L02:testrax,raxjle short M01_L04movzxr11d,dxM01_L03:movzxr8d,word ptr [rcx+r9*2]cmpr8d,r11dje near ptr M01_L16incr9decraxtestrax,raxjg short M01_L03M01_L04:cmpr9,r10jge near ptr M01_L12learax,[rcx+r9*2]movr11,raxtestr11b,1Fje short M01_L06movzxr11d,dx vmovd xmm0,r11dvpbroadcastwxmm0,xmm0vmovupdxmm1,[rax] vpcmpeqw xmm0,xmm0,xmm1 vpmovmskb r11d,xmm0testr11d,r11djne short M01_L05addr9,8jmp short M01_L06M01_L05:xoreax,eaxtzcnteax,r11dmovr10d,eaxshrr10d,1Faddeax,r10dsareax,1addeax,r9djmp near ptr M01_L17M01_L06:movrax,r10subrax,r9andrax,0FFFFFFFFFFFFFFF0testrax,raxjle short M01_L08movzxr11d,dx vmovd xmm0,r11dvpbroadcastwymm0,xmm0M01_L07:vmovupdymm1,[rcx+r9*2] vpcmpeqw ymm1,ymm0,ymm1 vpmovmskb r8d,ymm1testr8d,r8djne short M01_L09addr9,10addrax,0FFFFFFFFFFFFFFF0testrax,raxjg short M01_L07M01_L08:movrax,r10subrax,r9andrax,0FFFFFFFFFFFFFFF8testrax,raxjle short M01_L11movzxr11d,dx vmovd xmm0,r11dvpbroadcastwxmm0,xmm0vmovupdxmm1,[rcx+r9*2] vpcmpeqw xmm0,xmm0,xmm1 vpmovmskb eax,xmm0testeax,eaxjne short M01_L10addr9,8jmp short M01_L11M01_L09:xoreax,eaxtzcnteax,r8dmovr10d,eaxshrr10d,1Faddeax,r10dsareax,1addeax,r9djmp short M01_L17M01_L10:tzcnteax,eaxmovedx,eaxshredx,1Faddeax,edxsareax,1addeax,r9djmp short M01_L17M01_L11:cmpr9,r10jge short M01_L12movrax,r10subrax,r9jmp near ptr M01_L01M01_L12:moveax,0FFFFFFFFvzeroupperpoprsiretM01_L13:leaeax,[r9+3]jmp short M01_L17M01_L14:leaeax,[r9+2]jmp short M01_L17M01_L15:leaeax,[r9+1]jmp short M01_L17M01_L16:moveax,r9dM01_L17:vzeroupperpoprsiret; Total bytes of code 462
; System.Memory.Span`1[[System.Char, System.Private.CoreLib]].IndexOfValue()subrsp,28movrdx,[rcx+18]testrdx,rdxjne short M00_L00xorr8d,r8dxoreax,eaxjmp short M00_L01M00_L00:lear8,[rdx+10]moveax,[rdx+8]M00_L01:movzxedx,word ptr [rcx+2C]movrcx,r8movr8d,eaxcall System.SpanHelpers.IndexOf(Char ByRef, Char, Int32)nopaddrsp,28ret; Total bytes of code 48
; System.SpanHelpers.IndexOf(Char ByRef, Char, Int32)pushrsivzeroupperxorr9d,r9dmovsxdr10,r8dmovrax,r10movr11,rcxtestr11b,1jne short M01_L01cmpr8d,10jl short M01_L01movrax,rcxnegeaxmovr8d,eaxshrr8d,1Faddeax,r8dsareax,1moveax,eaxandrax,7cmprax,4jl short M01_L02M01_L00:lear8,[rcx+r9*2]movzxr11d,dxmovzxesi,word ptr [r8]cmpr11d,esije near ptr M01_L16movzxesi,word ptr [r8+2]cmpr11d,esije near ptr M01_L15movzxesi,word ptr [r8+4]cmpr11d,esije near ptr M01_L14movzxr8d,word ptr [r8+6]cmpr11d,r8dje near ptr M01_L13addr9,4addrax,0FFFFFFFFFFFFFFFCM01_L01:cmprax,4jge short M01_L00M01_L02:testrax,raxjle short M01_L04movzxr11d,dxM01_L03:movzxr8d,word ptr [rcx+r9*2]cmpr8d,r11dje near ptr M01_L16incr9decraxtestrax,raxjg short M01_L03M01_L04:cmpr9,r10jge near ptr M01_L12learax,[rcx+r9*2]movr11,raxmovr8d,r11dtestr8b,1Fje short M01_L06movzxr11d,dx vmovd xmm0,r11dvpbroadcastwxmm0,xmm0vmovupdxmm1,[rax] vpcmpeqw xmm0,xmm0,xmm1 vpmovmskb r11d,xmm0testr11d,r11djne short M01_L05addr9,8jmp short M01_L06M01_L05:xorr10d,r10dtzcntr10d,r11dshrr10d,1movedx,r10dmoveax,edxaddeax,r9djmp near ptr M01_L17M01_L06:movrax,r10subrax,r9andrax,0FFFFFFFFFFFFFFF0jle short M01_L08movzxr11d,dx vmovd xmm0,r11dvpbroadcastwymm0,xmm0M01_L07:vmovupdymm1,[rcx+r9*2] vpcmpeqw ymm1,ymm0,ymm1 vpmovmskb r8d,ymm1testr8d,r8djne short M01_L09addr9,10addrax,0FFFFFFFFFFFFFFF0testrax,raxjg short M01_L07M01_L08:movrax,r10subrax,r9andrax,0FFFFFFFFFFFFFFF8jle short M01_L11movzxr11d,dx vmovd xmm0,r11dvpbroadcastwxmm0,xmm0vmovupdxmm1,[rcx+r9*2] vpcmpeqw xmm0,xmm0,xmm1 vpmovmskb eax,xmm0testeax,eaxjne short M01_L10addr9,8jmp short M01_L11M01_L09:xoreax,eaxtzcnteax,r8dshreax,1movr10d,eaxmoveax,r10daddeax,r9djmp short M01_L17M01_L10:xoredx,edxtzcntedx,eaxshredx,1movecx,edxmoveax,ecxaddeax,r9djmp short M01_L17M01_L11:cmpr9,r10jge short M01_L12movrax,r10subrax,r9jmp near ptr M01_L01M01_L12:moveax,0FFFFFFFFvzeroupperpoprsiretM01_L13:leaeax,[r9+3]jmp short M01_L17M01_L14:leaeax,[r9+2]jmp short M01_L17M01_L15:leaeax,[r9+1]jmp short M01_L17M01_L16:moveax,r9dM01_L17:vzeroupperpoprsiret; Total bytes of code 451
Thanks @adamsitnik for collecting the numbers. Few things:
The original issue was regression between July 15 and July 21 but it looks like this is a regresison between .NET Core 3.1 and .NET 5. Which version of .NET 5 did you check? Was it preview8 or rc1? Can you share the commit hash, if possible?
Also, the original issue was Ubuntu only (or that is what was reported), but looks like it also regress on Windows.
I wanted to see the latest numbers for this benchmark to see if this has bimodel trend, but I am not sure how to get that data.
Update: Looking at the jitdiff, I don't see anything suspicious. The code size reduced from 462 -> 451 bytes.
Activity
DrewScoggins commentedon Jul 21, 2020
This one is a bit noisy, but @AndyAyersMS and @kunalspathak wanted to take a look at it.
kunalspathak commentedon Jul 24, 2020
I compared JIT output of baseline vs. test and didn't find anything noticeably different:
Chronometer:.cctor(). This probably callsStopWatch.get_ProcessorArchitecture- Changes in don't always aquite lock when calling RuntimeInformation.OSArchitecture and OSArchitecture.ProcessArchitecture #39196 and add OSPlatform.macOS, switch to OrdinalIgnoreCase for OSPlatform comparisons #39209. These look safe and I don't think it would even impact the benchmark code.OSPlatform:.cctor()- Changes in add OSPlatform.macOS, switch to OrdinalIgnoreCase for OSPlatform comparisons #39209 and Add OSPlatform entries for iOS/tvOS/watchOS/Android #36704 but again, don't think it would impact benchmark.I also saw that we are eliminating redundant
testinstruction done in #38586.Below is the baseline and test output I produced by locally building
clrjit.dllfor baseline and test and running benchmarks with below environment variables:indexofvalue.test.txt
indexofvalue.baseline.txt
Update:
Guid:TryParseHex()made in Add methods to convert between hexadecimal strings and bytes #37546, but I don't see how it will be related to the benchmark.danmoseley commentedon Jul 24, 2020
@DrewScoggins thanks for making sure the diff link is against the runtime repo. However this still produces a unicorn as it covers July 14-July 21. From eyeballing the graph, shouldn't the SHA's be about July 14-July 15?
(I realize that viewing even the tightly bracketed diff in Github is often not going to be feasible, but having well bracketed SHA's to examine offline is certainly important.)
DrewScoggins commentedon Jul 24, 2020
Yes, getting a tight bracket is very important, and it is something that we are thinking about how to solve in a consistent, accurate, and automated fashion. In the meantime, we believed that having a link that can at least bracket to the time of the report, in this case a week, was still useful as a starting point. For what it is worth, when I clicked the link I was able to get the comparison and didn't see an error, although I have had that happen plenty of times.
For now what we will do is when a bug is copied over we will use the tools in the generated report to try and tighten the window as best we can for the diff link. It might not be perfect, but hopefully will be a start.
danmoseley commentedon Jul 24, 2020
@DrewScoggins makes sense. Sounds good. I hope it didn't appear as a criticism. I see this as an iterative process to make these as useful as possible.
adamsitnik commentedon Aug 14, 2020
I was able to reproduce the regression. Link to asm diff https://www.diffchecker.com/daxuXSFS full details below:
Details
.NET Core 3.1.6 (CoreCLR 4.700.20.26901, CoreFX 4.700.20.31603), X64 RyuJIT
.NET Core 5.0.0 (CoreCLR 5.0.20.40416, CoreFX 5.0.20.40416), X64 RyuJIT
kunalspathak commentedon Aug 14, 2020
Thanks @adamsitnik for collecting the numbers. Few things:
Update: Looking at the jitdiff, I don't see anything suspicious. The code size reduced from 462 -> 451 bytes.
DrewScoggins commentedon Aug 14, 2020
You can find the full test history here, https://pvscmdupload.blob.core.windows.net/reports/08_13_2020/allTestHistory/System.Memory.Span(Char).IndexOfValue(Size%3A%20512).html
adamsitnik commentedon Aug 17, 2020
Same as #39721 this regression is caused by code alignment:
Details
EnvironmentVariables=COMPlus_JitAlignLoops=0 PowerPlanMode=00000000-0000-0000-0000-000000000000 Runtime=.NET Core 5.0
Arguments=/p:DebugType=portable Toolchain=netcoreapp5.0 IterationTime=250.0000 ms
MaxIterationCount=20 MinIterationCount=15 WarmupCount=1
.NET Core 5.0.0 (CoreCLR 5.0.20.40416, CoreFX 5.0.20.40416), X64 RyuJIT
EnvironmentVariables=COMPlus_JitAlignLoops=1 PowerPlanMode=00000000-0000-0000-0000-000000000000 Runtime=.NET Core 5.0
Arguments=/p:DebugType=portable Toolchain=netcoreapp5.0 IterationTime=250.0000 ms
MaxIterationCount=20 MinIterationCount=15 WarmupCount=1
.NET Core 5.0.0 (CoreCLR 5.0.20.40416, CoreFX 5.0.20.40416), X64 RyuJIT
AndyAyersMS commentedon Aug 17, 2020
Linking to #8108.