Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@dotnet-bot
Copy link

This PR contains mirrored changes from dotnet/coreclr

Please REBASE this PR when merging

benaadams and others added 5 commits March 22, 2018 22:26
Two main changes:
1. Rewrote the formatting to use span, only to then discover that we already had almost exactly the same implementation in Utf8Formatter.  As that one had some extra optimizations around JIT behaviors, I ported that over instead.
2. Avoided [ThreadStatic] lookups unless necessary.

ToString/TryFormat for "o"/"O" improve by ~2.5x.

ToString/TryFormat for "r"/"R" improve by ~3x.

Signed-off-by: dotnet-bot-corefx-mirror <[email protected]>
@Anipik
Copy link

Anipik commented Mar 22, 2018

@ahsonkhan i fixed this part.
@jkotas there may be some missing commits from corefx to coreclr due to this. I will check and remove it after this PR have been merged

@stephentoub
Copy link
Member

@ahsonkhan, this is failing the netfx build with:

D:\j\workspace\windows-TGrou---2a8f9c29\Tools\ApiCompat.targets(109,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.Read<T>(System.ReadOnlySpan<System.Byte>)' does not exist in the implementation but it does exist in the contract. [D:\j\workspace\windows-TGrou---2a8f9c29\src\System.Memory\src\System.Memory.csproj]
D:\j\workspace\windows-TGrou---2a8f9c29\Tools\ApiCompat.targets(109,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.TryRead<T>(System.ReadOnlySpan<System.Byte>, T)' does not exist in the implementation but it does exist in the contract. [D:\j\workspace\windows-TGrou---2a8f9c29\src\System.Memory\src\System.Memory.csproj]
D:\j\workspace\windows-TGrou---2a8f9c29\Tools\ApiCompat.targets(109,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.TryWrite<T>(System.Span<System.Byte>, T)' does not exist in the implementation but it does exist in the contract. [D:\j\workspace\windows-TGrou---2a8f9c29\src\System.Memory\src\System.Memory.csproj]
D:\j\workspace\windows-TGrou---2a8f9c29\Tools\ApiCompat.targets(109,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.Write<T>(System.Span<System.Byte>, T)' does not exist in the implementation but it does exist in the contract. [D:\j\workspace\windows-TGrou---2a8f9c29\src\System.Memory\src\System.Memory.csproj]
D:\j\workspace\windows-TGrou---2a8f9c29\Tools\ApiCompat.targets(123,5): error : MatchingRefApiCompat failed - The reference assembly doesn't match all the APIs in the implementation for 'D:\j\workspace\windows-TGrou---2a8f9c29\bin\AnyOS.AnyCPU.Release\System.Memory\netstandard\System.Memory.dll'. To 

@ahsonkhan
Copy link

Yep. I am just about to cherry-pick the commits from #28296 into here to resolve the CI failures.

@ahsonkhan
Copy link

It looks like we need a new ProjectN build.

UWP NETNative x86 Release Build

16:51:09 D:\j\workspace\windows-TGrou---c60886e1\external\test-runtime\XUnit.Runtime.depproj(202,5): warning : Could not find the TestILC Tools at 'D:\j\workspace\windows-TGrou---c60886e1\packages\TestILC.x86ret\1.0.0-beta-26322-00\TestILC'. Please run sync.
16:51:09 D:\j\workspace\windows-TGrou---c60886e1\src\shims\ApiCompat.proj(80,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.AsBytes<T>(System.ReadOnlySpan<T>)' does not exist in the implementation but it does exist in the contract.
16:51:09 D:\j\workspace\windows-TGrou---c60886e1\src\shims\ApiCompat.proj(80,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.AsBytes<T>(System.Span<T>)' does not exist in the implementation but it does exist in the contract.
16:51:09 D:\j\workspace\windows-TGrou---c60886e1\src\shims\ApiCompat.proj(80,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.Read<T>(System.ReadOnlySpan<System.Byte>)' does not exist in the implementation but it does exist in the contract.
16:51:09 D:\j\workspace\windows-TGrou---c60886e1\src\shims\ApiCompat.proj(80,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.TryRead<T>(System.ReadOnlySpan<System.Byte>, T)' does not exist in the implementation but it does exist in the contract.
16:51:09 D:\j\workspace\windows-TGrou---c60886e1\src\shims\ApiCompat.proj(80,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.TryWrite<T>(System.Span<System.Byte>, T)' does not exist in the implementation but it does exist in the contract.
16:51:09 D:\j\workspace\windows-TGrou---c60886e1\src\shims\ApiCompat.proj(80,5): error : MembersMustExist : Member 'System.Runtime.InteropServices.MemoryMarshal.Write<T>(System.Span<System.Byte>, T)' does not exist in the implementation but it does exist in the contract.
16:51:09 D:\j\workspace\windows-TGrou---c60886e1\src\shims\ApiCompat.proj(88,5): error : ApiCompat failed comparing netstandard to uapaot

@jkotas
Copy link
Member

jkotas commented Mar 23, 2018

Add baseline for the ProjectN missing APIs. Do not wait for the ProjectN update.

@ahsonkhan
Copy link

ahsonkhan commented Mar 23, 2018

This is still failing on UWP.

Should I be modifying the baseline here instead (or both?): https://github.com/dotnet/corefx/blob/master/src/shims/ApiCompatBaseline.uapaot.netstandard20.txt?

@ahsonkhan
Copy link

OSX.1012.Amd64.Open-x64-Debug
Known test failure - https://github.com/dotnet/corefx/issues/28398
cc @safern, @MarcoRossignoli

Windows x86 Release Build
Constructor1_LockedFileAsCodeBaseArgument_ShouldThrowFileLoad
Constructor4_LockedFileAsCodeBaseArgument_ShouldThrowFileLoad
...
https://mc.dot.net/#/user/dotnet-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/332f2d5c7bcca801256bc9d93c80715fe72cc1e4/workItem/System.ComponentModel.Composition.Tests/analysis/xunit/System.ComponentModel.Composition.AssemblyCatalogConstructorTests~2FConstructor1_LockedFileAsCodeBaseArgument_ShouldThrowFileLoad

Unhandled Exception of Type System.IO.FileNotFoundException
Message :
System.IO.FileNotFoundException : Could not find file 'C:\\U'.
Stack Trace :
   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) in E:\A\_work\71\s\src\mscorlib\shared\System\IO\FileStream.Windows.cs:line 1650
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) in E:\A\_work\71\s\src\mscorlib\shared\System\IO\FileStream.Win32.cs:line 42
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in E:\A\_work\71\s\src\mscorlib\shared\System\IO\FileStream.cs:line 230
   at System.ComponentModel.Composition.AssemblyCatalogConstructorTests.Constructor_LockedFileAsCodeBaseArgument_ShouldThrowFileLoad(Func`2 catalogCreator) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\Hosting\AssemblyCatalogTests.cs:line 79
   at System.ComponentModel.Composition.AssemblyCatalogConstructorTests.Constructor1_LockedFileAsCodeBaseArgument_ShouldThrowFileLoad() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\Hosting\AssemblyCatalogTests.cs:line 176

Similar to #27737 (comment)

cc @danmosemsft, @Anipik, @ruben-ayrapetyan

@ahsonkhan
Copy link

@dotnet-bot test OSX x64 Debug Build
@dotnet-bot test Windows x86 Release Build

@ahsonkhan ahsonkhan merged commit 3767d30 into master Mar 23, 2018
@ahsonkhan ahsonkhan deleted the mirror-merge-9584546 branch March 23, 2018 05:48
@karelz karelz added this to the 2.1.0 milestone Mar 27, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Small tweaks to Dict asm size (dotnet/coreclrdotnet/corefx#17096)

Signed-off-by: dotnet-bot-corefx-mirror <[email protected]>

* Moving Span APIs that allow skipping visibility checks to MemoryMarshal (dotnet/corefx#17087)

Signed-off-by: dotnet-bot-corefx-mirror <[email protected]>

* Improve DateTime{Offset} "r" and "o" formatting performance (dotnet/corefx#17092)

Two main changes:
1. Rewrote the formatting to use span, only to then discover that we already had almost exactly the same implementation in Utf8Formatter.  As that one had some extra optimizations around JIT behaviors, I ported that over instead.
2. Avoided [ThreadStatic] lookups unless necessary.

ToString/TryFormat for "o"/"O" improve by ~2.5x.

ToString/TryFormat for "r"/"R" improve by ~3x.

Signed-off-by: dotnet-bot-corefx-mirror <[email protected]>

* Rename {Try}Read/WriteMachineEndian to just {Try}Read/Write (dotnet/corefx#17106)

Signed-off-by: dotnet-bot-corefx-mirror <[email protected]>

* Fix incorrect array dereference. (dotnet/coreclrdotnet/corefx#17113)

Signed-off-by: dotnet-bot-corefx-mirror <[email protected]>

* Move Span APIs that allow skipping visibility checks to MemoryMarshal

* Rename {Try}Read/WriteMachineEndian to just {Try}Read/Write

* Update calls to BinaryPrimitives.ReadMachineEndian

* Rename calls to ReadMachineEndian in System.Memory perf tests.

* Add ApiCompatBaseline for UWP NETNative

* Add to ApiCompatBaseline for UWP NETNative netstandard20


Commit migrated from dotnet/corefx@3767d30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants