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

Added value type serialization support#36506

Merged
ahsonkhan merged 2 commits intodotnet:masterfrom
YohDeadfall:struct-serialization
May 20, 2019
Merged

Added value type serialization support#36506
ahsonkhan merged 2 commits intodotnet:masterfrom
YohDeadfall:struct-serialization

Conversation

@YohDeadfall
Copy link
Copy Markdown
Contributor

This pull request add value type serialization support, but it works only for properties. Therefore, it fixes #36240 partly. Opened #36505 to track field serialization.

Open questions:

  • Should a constructor be generated for primitive types or not? ReflectionMaterializer does it for all types, but ReflectionEmitMaterializer didn't previously.

/cc @ahsonkhan @steveharter

@steveharter
Copy link
Copy Markdown
Contributor

Should a constructor be generated for primitive types or not? ReflectionMaterializer does it for all types, but ReflectionEmitMaterializer didn't previously.

The reason for ReflectionEmitMaterializer is performance (and without boxing), so base decisions on that...

Also currently "data types" (Decimal, int, etc) are created explicitly in JsonValueConverter.TryRead. These are "single value" data types. So this commit will be useful for value types that are not used as "single-value data types".

generator.Emit(OpCodes.Ldloca_S, local);
generator.Emit(OpCodes.Initobj, type);
generator.Emit(OpCodes.Ldloc, local);
generator.Emit(OpCodes.Box, type);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have to be boxed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it boxes because JsonClassInfo.ConstructorDelegate has object as a return type. It's definitely possible to avoid boxing via preallocated ByReference<T> for each struct and storing it in a TLS or in a shared pool, but I intentionally haven't implemented that yet. The first step is basic support with tests, and optimization as the second after a discussion.

{
get
{
yield return new object[] { typeof(SimpleTestStruct), SimpleTestStruct.s_data };
Copy link
Copy Markdown

@ahsonkhan ahsonkhan Apr 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the goal of this PR is to provide struct support in the serializer, we should consider adding a lot more test cases, including nested types (struct within reference, reference within struct, etc.).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't done that because structs have no difference from primitive value types and decimal which isn't primitive. The idea of that test was to check that setting a value on a struct instance sets the value on the original struct on the heap and not on its stack allocated copy. But if it's required, I can write more tests. Should I do that and should I duplicate tests of SimpleTestClass?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to at least verify multiple properties are applied from json.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

@steveharter I've rebased the PR and am waiting for another review.

realMethod.Name,
type,
".ctor",
typeof(object),
Copy link
Copy Markdown
Contributor

@steveharter steveharter Apr 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use typeof(object) here for the non-struct case? However it probably doesn't matter since it doesn't imply boxing for ref types.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to introduce condition here. JsonClassInfo.ConstructorDelegate returns an object.


internal void Set(object obj, TDeclaredProperty value)
{
if (default(TClass) == null)
Copy link
Copy Markdown
Contributor

@steveharter steveharter Apr 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using default on every getter\setter may be expensive. It seems like an easy thing to cache as a bool (class or struct).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a well known optimization. The JIT eliminates the check and replaces it by a constant value (true for reference types and Nullable<T>, false for other value types).

else
{
var get = (GetPropertyValueByRef)_get;
return get(ref Unsafe.As<ByReference>(obj).Value);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this only work for your test class with a single value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ByReference represents a boxed object, this is how the CLR stores value types on the heap. The code does unsafe cast of a boxed value to ByReference and gets a reference to its actual value.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkotas any concern using class like this to get access to the real value from a boxed object?:

private sealed class ByReference 
{ 
        public TClass Value; 
} 

...
ref Unsafe.As<ByReference>(obj).Value

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unsafe construct that depends on runtime implementation details. I do not think it is a good idea to use it in high-level libraries like this one.

Can you use Unsafe.Unbox instead?

Copy link
Copy Markdown
Contributor Author

@YohDeadfall YohDeadfall Apr 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow missed that method, thanks for pointing out. It will make the code a bit trickier, but it's definitely possible to use Unsafe.Unbox<T> here.

}
}

internal void Set(object obj, TDeclaredProperty value)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the struct boxed on each setter? So the new property value won't be applied to obj?

Ideally this is ref TClass obj for structs so we don't box (and unbox) but that requires re-factoring of other calling code. If we change it to ref object obj and for structs below cast obj to TClass and then re-assign that back to obj that would work but slow (unbox + box)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already boxed and stored on the heap. object means a reference to a class instance or a reference to a boxed value type located on the heap too. ref object is a pointer to a local which stores a pointer to the actual object.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the my sentence was because I wasn't sure the ByReference class was sufficient.

Copy link
Copy Markdown
Contributor

@steveharter steveharter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please verify multiple properties on a struct works.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

Removed the dirty trick with Unsafe.As<T> and added member access generator which doesn't emit IL. This is what @GrabYourPitchforks asked in #24390.

@GrabYourPitchforks
Copy link
Copy Markdown
Member

This isn't quite what I had in mind with that proposal. Additionally, is there any way to do this without use of Unsafe APIs? Putting those into a serializer / deserializer makes me extraordinarily uncomfortable.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

Sure, it's possible, but there is a cost in complexity. A stack frame should store a wrapper around the struct in the ReturnValue property or a class instance for reference types. For example see ByReference<T> and how it's used in npgsql/npgsql#2402.

Speaking about your proposal, how do you plan to implement property accessors ?

@GrabYourPitchforks
Copy link
Copy Markdown
Member

I had planned on using a combination of a force-JIT flag and calli, which should be lighter-weight than bouncing through multiple delegate invocations. But importantly, the complexity of the unsafe code would be wholly encapsulated within coreclr (where we could keep it in sync with how the runtime works) rather than spread across non-coreclr packages which would have to be serviced independently if something in the runtime changes or if a bug were discovered.

(This shouldn't affect your PR much. It just means that if that other issue does make its way in at some future point then this code can be refactored to ride atop it, which should get a measurable perf boost.)

If the alternative for not using Unsafe.Unbox is added complexity, I'll not push back. :) Thanks for your responses!

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

@GrabYourPitchforks Totally agree that such a kind of stuff should be moved off. I don't like the chained delegates I introduced, but there is no other way for now except code generation. So I'm looking forward to ReflectionServices (:

@steveharter Rebased and squashed commits.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

@steveharter Rebased again to include changes in the test project.

}
else
{
var propertyGetter = CreateDelegate<GetProperty<TClass, TProperty>>(getMethodInfo);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concerned about performance here. Have you measured?

Some comments here would be good as well - like the double hop.

I believe you need both a strongly-typed class (TClass) and property (TProperty) in order to have a direct reference to the getter\setter (instead of methodinfo.invoke) which we have above however then this new delegate below is returned which doesn't have a strongly-typed TClass.

Also concerned about the extra hop (assuming there is one).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's slower (not measured, but it is) because of the second delegate one line below. Unfortunately, it's a price of Unsafe.Unbox<T> which has a constraint on T. I will think about merging two generic JsonPropertyInfo into a single class and about adding specialized classes for struct and class handling.

this new delegate below is returned which doesn't have a strongly-typed TClass.

Yep, because passing a value as TClass when it's a structure will cause passing it by value, not by reference. To avoid it I pass an object and get a reference to it in lines 80 and 89. As I said, there is a constraint on T which can be avoided by some magic with delegates. The JIT doesn't check constrains, but the compiler does,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we can avoid the second delegate for the reference type (non-struct) case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope due to the signature check.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me benchmark this and see what the hit is.

@steveharter
Copy link
Copy Markdown
Contributor

cc @rynowak @JamesNK any concerns with supporting struct at the highest level? (the struct must still have public properties - fields not supported with this PR).

For areas that expose a top-level type, like in extensibilty scenarios, this means we will want to pass the type argument by reference (ref or in modifier) to allow the struct to be modified and\or to avoid unnecessary copies. Passing a reference type with ref or in is allowed, so we should be OK syntax-wise.

@ahsonkhan
Copy link
Copy Markdown

Imo, it could be difficult for customers to reason about the functionality with conditional support like this, so we should avoid piecemeal support of the struct feature. Today, the serializer supports classes. If we want to support structs, we should make sure that nested/custom structs (structs within reference types, reference types within structs, etc.) are supported, potentially with a story for fields/default values/ctors.

@rynowak
Copy link
Copy Markdown
Member

rynowak commented Apr 24, 2019

Are there major blockers to lighting up value types all over the stack (even if it's slightly ineffient? requires boxing, etc).

I'd like to say yes, to having struct support, but it's hard to explain to people why it would only work as a top-level object.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

I've opened dotnet/coreclr#24189 to get some clarifications about an AOT friendly way to get the underlying value of an nullable, but for now it's possible to do the same trick which exists in Npgsql (see npgsql/npgsql#1773 for example). I think that it's okay because the current implementation doesn't support AOT out from the box.

So I can invert the code and make two final property infos, one for reference types and another one for value types. Nullable handling logic will be implemented via a delegate and a method to take an underlying value only if TDeclaredProperty is Nullable<T>. This path will be slower than non-nullable due to a delegate invocation, but the code will be clean and there will be no perf regression in other places. For example, see npgsql/npgsql#2402.

@steveharter
Copy link
Copy Markdown
Contributor

cc @JeremyKuhne has a scenario where we have a top-level struct with public properties (actually just our JsonElement).

@steveharter
Copy link
Copy Markdown
Contributor

@ahsonkhan @rynowak any final thoughts? I recommend supporting this. The other 3 serializers I tested (Json.Net, Jil, Utf8Json) support structs at top-level.

The perf hit on end-to-end is within the margin of error (simple POCO type with 10 properties. Struct performance is the same.

Before:

|           Method |      Mean |      Error |     StdDev |    Median |       Min |       Max | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op |
|----------------- |----------:|-----------:|-----------:|----------:|----------:|----------:|------------:|------------:|------------:|--------------------:|
| System.Text.Json |  1.937 us |  0.0457 us |  0.0526 us |  1.930 us |  1.857 us |  2.067 us |      0.1210 |           - |           - |               512 B |

After:

class
|           Method |      Mean |     Error |    StdDev |    Median |       Min |       Max | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op |
|----------------- |----------:|----------:|----------:|----------:|----------:|----------:|------------:|------------:|------------:|--------------------:|
| System.Text.Json |  1.965 us | 0.0393 us | 0.0386 us |  1.966 us |  1.913 us |  2.021 us |      0.1211 |           - |           - |               512 B |

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

I've changed the emit materializer behavior to support value types with parameterless constructors to align it with Activator.CreateInstance<T> and resolved merge conflicts.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

@steveharter @ahsonkhan Rebased the PR again and ready for the final review.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

What types of checks were you looking for?

Which run on every pull request. As you know some steps fail due to unrelated reasons. So I would like to push only them, not all pipelines.

@ahsonkhan
Copy link
Copy Markdown

Which run on every pull request. As you know some steps fail due to unrelated reasons. So I would like to push only them, not all pipelines.

I don't think re-running a specific leg via a command is supported yet, with azure pipelines.

I can re-run a specific leg from the UI (under details), but that's not fully available yet either.

Unfortunately, rerun button on checks tab and retry button in build's UI are only available for contributors that are part of the Microsoft organization.

cc @safern

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

Assigned additional memory to the VM on which I'm building Core FX and enabled page files, but still getting OutOfMemoryException.

UNHANDLED EXCEPTIONS FROM PROCESS 23284:
=====================
5/6/2019 11:11:26 PM
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at Microsoft.Build.BackEnd.TargetEntry.GetErrorTargets(ProjectLoggingContext projectLoggingContext)
   at Microsoft.Build.BackEnd.TargetBuilder.ProcessTargetStack(ITaskBuilder taskBuilder)
   at Microsoft.Build.BackEnd.TargetBuilder.Microsoft.Build.BackEnd.ITargetBuilderCallback.LegacyCallTarget(String[] targets, Boolean continueOnError, ElementLocation taskLocation)
   at Microsoft.Build.BackEnd.TaskHost.InternalBuildProjects(String[] projectFileNames, String[] targetNames, IDictionary[] globalProperties, IList`1[] undefineProperties, String[] toolsVersion, Boolean returnTargetOutputs, Boolean skipNonexistentTargets)
   at Microsoft.Build.BackEnd.MSBuild.ExecuteTargets(ITaskItem[] projects, Dictionary`2 propertiesTable, String[] undefineProperties, List`1 targetLists, Boolean stopOnFirstFailure, Boolean rebaseOutputs, IBuildEngine3 buildEngine, TaskLoggingHelper log, List`1 targetOutputs, Boolean unloadProjectsOnCompletion, String toolsVersion, Boolean skipNonexistentTargets)
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
   at Microsoft.Build.BackEnd.TaskBuilder.InitializeAndExecuteTask(TaskLoggingContext taskLoggingContext, ItemBucket bucket, IDictionary`2 taskIdentityParameters, TaskHost taskHost, TaskExecutionMode howToExecuteTask)
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteBucket(TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Dictionary`2 lookupHash)
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(TaskExecutionMode mode, Lookup lookup)
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(TargetLoggingContext loggingContext, BuildRequestEntry requestEntry, ITargetBuilderCallback targetBuilderCallback, ProjectTargetInstanceChild taskInstance, TaskExecutionMode mode, Lookup inferLookup, Lookup executeLookup, CancellationToken cancellationToken)
   at Microsoft.Build.BackEnd.TargetEntry.ProcessBucket(ITaskBuilder taskBuilder, TargetLoggingContext targetLoggingContext, TaskExecutionMode mode, Lookup lookupForInference, Lookup lookupForExecution)
   at Microsoft.Build.BackEnd.TargetEntry.ExecuteTarget(ITaskBuilder taskBuilder, BuildRequestEntry requestEntry, ProjectLoggingContext projectLoggingContext, CancellationToken cancellationToken)
   at Microsoft.Build.BackEnd.TargetBuilder.ProcessTargetStack(ITaskBuilder taskBuilder)
   at Microsoft.Build.BackEnd.TargetBuilder.BuildTargets(ProjectLoggingContext loggingContext, BuildRequestEntry entry, IRequestBuilderCallback callback, String[] targetNames, Lookup baseLookup, CancellationToken cancellationToken)
   at Microsoft.Build.BackEnd.RequestBuilder.BuildProject()
   at Microsoft.Build.BackEnd.RequestBuilder.BuildAndReport()
   at Microsoft.Build.BackEnd.RequestBuilder.RequestThreadProc(Boolean setThreadParameters)
===================
UNHANDLED EXCEPTIONS FROM PROCESS 23144:
=====================
5/6/2019 11:11:26 PM
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at NuGet.Build.Tasks.GetReferenceNearestTargetFrameworkTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
   at Microsoft.Build.BackEnd.TaskBuilder.InitializeAndExecuteTask(TaskLoggingContext taskLoggingContext, ItemBucket bucket, IDictionary`2 taskIdentityParameters, TaskHost taskHost, TaskExecutionMode howToExecuteTask)
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteBucket(TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Dictionary`2 lookupHash)
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(TaskExecutionMode mode, Lookup lookup)
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(TargetLoggingContext loggingContext, BuildRequestEntry requestEntry, ITargetBuilderCallback targetBuilderCallback, ProjectTargetInstanceChild taskInstance, TaskExecutionMode mode, Lookup inferLookup, Lookup executeLookup, CancellationToken cancellationToken)
   at Microsoft.Build.BackEnd.TargetEntry.ProcessBucket(ITaskBuilder taskBuilder, TargetLoggingContext targetLoggingContext, TaskExecutionMode mode, Lookup lookupForInference, Lookup lookupForExecution)
   at Microsoft.Build.BackEnd.TargetEntry.ExecuteTarget(ITaskBuilder taskBuilder, BuildRequestEntry requestEntry, ProjectLoggingContext projectLoggingContext, CancellationToken cancellationToken)
   at Microsoft.Build.BackEnd.TargetBuilder.ProcessTargetStack(ITaskBuilder taskBuilder)
   at Microsoft.Build.BackEnd.TargetBuilder.BuildTargets(ProjectLoggingContext loggingContext, BuildRequestEntry entry, IRequestBuilderCallback callback, String[] targetNames, Lookup baseLookup, CancellationToken cancellationToken)
   at Microsoft.Build.BackEnd.RequestBuilder.BuildProject()
   at Microsoft.Build.BackEnd.RequestBuilder.BuildAndReport()
   at Microsoft.Build.BackEnd.RequestBuilder.RequestThreadProc(Boolean setThreadParameters)
===================

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

It's strange that even 48 GB of RAM and 16 GB of page files isn't enough to build the solution. Task Manager showed no high memory usage, only 16 GB of memory were used before fails.

@ahsonkhan
Copy link
Copy Markdown

Assigned additional memory to the VM on which I'm building Core FX and enabled page files, but still getting OutOfMemoryException.

@ViktorHofer, @karelz - have either of you seen this sort of issue before when building corefx locally? Do you have some guidance or solution here for @YohDeadfall? I have not hit OOM myself when building corefx.

@ViktorHofer
Copy link
Copy Markdown
Member

ViktorHofer commented May 8, 2019

@rainersigwald any idea what's causing the OOM in the build (see the callstack above)?

@karelz
Copy link
Copy Markdown
Member

karelz commented May 8, 2019

@YohDeadfall can you please try the build on another machine/VM just as a test?

@rainersigwald
Copy link
Copy Markdown
Member

The callstack doesn't jump out at me. What version of MSBuild, running on what runtime (MSBuild.exe on desktop, or .NET core), is running? On what OS? Is it possible to capture a memory dump of the processes before they fail?

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

@rainersigwald

Can it be due to high parallelism?

What version of MSBuild, running on what runtime (MSBuild.exe on desktop, or .NET core), is running?

While build I saw that MSBuild shipped with VS2019 was used. It's version is 16.1.68-preview+g64a5b6be6d.

On what OS?

OS Name Microsoft Windows 10 Pro Insider Preview
Version 10.0.18895 Build 18895

Is it possible to capture a memory dump of the processes before they fail?

Done. How can I send them to you? Via e-mail?

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

/azp run corefx-ci

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

@rainersigwald It fails in random places, but with OutOfMemoryException. So I don't think it's due to a bug somewhere.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

@YohDeadfall can you please try the build on another machine/VM just as a test?

Tested on a real machine. Got out of memory three times... Here its configuration:

OS Name	Microsoft Windows 10 Pro	
Version	10.0.18362 Build 18362	
Other OS Description 	Not Available	
OS Manufacturer	Microsoft Corporation	
System Manufacturer	ASUSTeK COMPUTER INC.	
System Model	Z9PE-D8 WS	
System Type	x64-based PC	
System SKU	SKU	
Processor	Intel(R) Xeon(R) CPU E5-2687W 0 @ 3.10GHz, 3101 Mhz, 8 Core(s), 16 Logical Processor(s)	
Processor	Intel(R) Xeon(R) CPU E5-2687W 0 @ 3.10GHz, 3112 Mhz, 8 Core(s), 16 Logical Processor(s)	
BIOS Version/Date	American Megatrends Inc. 5701, 1/7/2015	
SMBIOS Version	2.7	
Embedded Controller Version	255.255	
BIOS Mode	Legacy	
BaseBoard Manufacturer	ASUSTeK COMPUTER INC.	
BaseBoard Product	Z9PE-D8 WS	
BaseBoard Version	1.0x	
Platform Role	Workstation
Hardware Abstraction Layer	Version = "10.0.18362.1"		
Installed Physical Memory (RAM)	64.0 GB	
Total Physical Memory	63.9 GB	
Available Physical Memory	60.0 GB	
Total Virtual Memory	70.3 GB	
Available Virtual Memory	66.1 GB	
Page File Space	6.37 GB	
Page File	C:\pagefile.sys	
dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview5-011568
 Commit:    b487ff10aa

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18362
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview5-011568\

Host (useful for support):
  Version: 3.0.0-preview5-27626-15
  Commit:  61f30f5a23

.NET Core SDKs installed:
  3.0.100-preview5-011568 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0-preview5-19227-01 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.0-preview5-27626-15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview5-27626-15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

And there are other problems on the physical machine:

Failed to create CoreCLR, HRESULT: 0x80004005
Failed to create CoreCLR, HRESULT: 0x8007000E
Failed to load the dll from [D:\Source\Repos\dotnet\corefx\.dotnet\shared\Microsoft.NETCore.App\3.0.0-preview3-27503-5\coreclr.dll], HRESULT: 0x800705AF
Failed to bind to CoreCLR at 'D:\Source\Repos\dotnet\corefx\.dotnet\shared\Microsoft.NETCore.App\3.0.0-preview3-27503-5\'
Failed to create CoreCLR, HRESULT: 0x80008088

@rainersigwald
Copy link
Copy Markdown
Member

Is it possible to capture a memory dump of the processes before they fail?

Done. How can I send them to you? Via e-mail?

I think the easiest way would be to file a Visual Studio feedback item at https://developercommunity.visualstudio.com/spaces/8/index.html. That should allow you to upload the memory dump. If you mention the item here I can short-circuit the routing process.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

Looks like that building Core FX in parallel causes the error. I've decreased core count from 32 to 8 on the VM, and everything goes well now.

@rainersigwald Here is a link to the issue.

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

BenchmarkDotNet=v0.11.3.1003-nightly, OS=Windows 10.0.18895
Intel Xeon CPU E5-2687W 0 3.10GHz, 1 CPU, 16 logical and 16 physical cores
.NET Core SDK=3.0.100-preview5-011568
  [Host]     : .NET Core 3.0.0-preview5-27626-15 (CoreCLR 4.6.27622.75, CoreFX 4.700.19.22408), 64bit RyuJIT
  Job-GBKDPQ : .NET Core ? (CoreCLR 3.0.19.26472, CoreFX 4.700.19.26901), 64bit RyuJIT
  Job-AEKLGR : .NET Core ? (CoreCLR 3.0.19.26472, CoreFX 4.700.19.26901), 64bit RyuJIT

Runtime=Core  IterationTime=250.0000 ms  MaxIterationCount=20  
MinIterationCount=15  WarmupCount=1  

IndexViewModel

Method Toolchain Mean Error StdDev Median Min Max Ratio RatioSD Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
DeserializeFromString \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 141.7 us 12.355 us 13.732 us 141.2 us 117.30 us 167.1 us 1.07 0.12 5.1813 0.5757 - 34.14 KB
DeserializeFromString \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 134.1 us 14.949 us 17.215 us 136.2 us 98.80 us 161.5 us 1.00 0.00 5.4825 0.5482 - 34.12 KB
DeserializeFromUtf8Bytes \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 130.0 us 12.012 us 13.833 us 132.9 us 99.46 us 146.0 us 1.03 0.14 3.3278 - - 21.85 KB
DeserializeFromUtf8Bytes \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 127.8 us 12.592 us 14.501 us 132.5 us 101.18 us 151.9 us 1.00 0.00 3.0691 - - 21.85 KB
DeserializeFromStream \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 144.4 us 11.991 us 13.809 us 143.4 us 124.24 us 172.8 us 1.02 0.13 3.2787 - - 21.92 KB
DeserializeFromStream \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 141.8 us 7.504 us 8.642 us 141.3 us 125.28 us 158.4 us 1.00 0.00 3.3426 - - 21.92 KB
Method Toolchain Mean Error StdDev Median Min Max Ratio RatioSD Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
SerializeToString \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 106.66 us 10.01 us 11.53 us 105.73 us 85.16 us 130.0 us 1.38 0.34 3.8007 - - 25568 B
SerializeToString \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 81.32 us 16.95 us 19.52 us 76.86 us 54.99 us 114.3 us 1.00 0.00 4.0323 - - 25568 B
SerializeToUtf8Bytes \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 106.82 us 11.29 us 13.00 us 112.37 us 83.82 us 123.6 us 1.04 0.17 1.8116 - - 13016 B
SerializeToUtf8Bytes \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 103.79 us 10.13 us 11.66 us 104.94 us 86.72 us 126.4 us 1.00 0.00 1.7007 - - 13016 B
SerializeToStream \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 91.95 us 13.09 us 15.07 us 89.33 us 70.13 us 123.3 us 1.15 0.42 - - - 432 B
SerializeToStream \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 85.71 us 15.42 us 17.75 us 88.66 us 53.03 us 112.1 us 1.00 0.00 - - - 432 B

Location

Method Toolchain Mean Error StdDev Median Min Max Ratio RatioSD Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
DeserializeFromString \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 6.022 us 0.6398 us 0.7368 us 6.057 us 4.654 us 7.430 us 1.00 0.18 0.0960 - - 680 B
DeserializeFromString \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 6.092 us 0.6066 us 0.6986 us 6.289 us 4.939 us 7.222 us 1.00 0.00 0.0974 - - 680 B
DeserializeFromUtf8Bytes \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 5.706 us 0.5394 us 0.6212 us 5.860 us 4.502 us 6.566 us 0.98 0.16 0.0694 - - 448 B
DeserializeFromUtf8Bytes \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 5.877 us 0.5027 us 0.5789 us 5.984 us 4.808 us 6.902 us 1.00 0.00 0.0681 - - 448 B
DeserializeFromStream \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 7.093 us 1.1429 us 1.3162 us 7.134 us 4.671 us 8.802 us 0.92 0.17 0.0757 - - 520 B
DeserializeFromStream \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 7.732 us 0.5761 us 0.6635 us 7.879 us 6.694 us 9.222 us 1.00 0.00 0.0762 - - 520 B
Method Toolchain Mean Error StdDev Median Min Max Ratio RatioSD Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
SerializeToString \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 3.618 us 0.5112 us 0.5887 us 3.756 us 1.988 us 4.554 us 1.06 0.29 0.0848 - - 576 B
SerializeToString \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 3.560 us 0.6034 us 0.6949 us 3.771 us 2.342 us 4.433 us 1.00 0.00 0.0850 - - 576 B
SerializeToUtf8Bytes \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 3.645 us 0.4270 us 0.4918 us 3.746 us 2.621 us 4.326 us 1.24 0.23 0.0508 - - 376 B
SerializeToUtf8Bytes \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 3.017 us 0.4553 us 0.5243 us 3.003 us 2.086 us 3.743 us 1.00 0.00 0.0590 - - 376 B
SerializeToStream \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 3.722 us 0.5015 us 0.5775 us 3.713 us 2.902 us 4.792 us 0.90 0.14 0.0159 - - 144 B
SerializeToStream \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 4.141 us 0.4203 us 0.4840 us 4.134 us 3.278 us 4.797 us 1.00 0.00 0.0189 - - 144 B

LoginViewModel

Method Toolchain Mean Error StdDev Median Min Max Ratio RatioSD Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
DeserializeFromString \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.322 us 0.1493 us 0.1719 us 2.341 us 2.010 us 2.617 us 1.07 0.20 0.0415 - - 280 B
DeserializeFromString \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.211 us 0.2216 us 0.2552 us 2.319 us 1.589 us 2.506 us 1.00 0.00 0.0434 - - 280 B
DeserializeFromUtf8Bytes \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.022 us 0.2532 us 0.2916 us 2.116 us 1.406 us 2.407 us 1.02 0.20 0.0232 - - 168 B
DeserializeFromUtf8Bytes \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.013 us 0.1892 us 0.2179 us 2.085 us 1.512 us 2.366 us 1.00 0.00 0.0211 - - 168 B
DeserializeFromStream \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 3.373 us 0.3632 us 0.4182 us 3.492 us 2.320 us 3.907 us 1.06 0.27 0.0255 - - 240 B
DeserializeFromStream \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 3.279 us 0.4215 us 0.4854 us 3.421 us 2.301 us 3.977 us 1.00 0.00 0.0347 - - 240 B
Method Toolchain Mean Error StdDev Median Min Max Ratio RatioSD Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
SerializeToString \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.675 us 0.1755 us 0.2021 us 1.696 us 1.270 us 2.020 us 1.01 0.16 0.0518 - - 336 B
SerializeToString \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.668 us 0.1523 us 0.1754 us 1.692 us 1.274 us 1.915 us 1.00 0.00 0.0524 - - 336 B
SerializeToUtf8Bytes \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.659 us 0.1756 us 0.2022 us 1.653 us 1.266 us 1.985 us 1.11 0.22 0.0362 - - 256 B
SerializeToUtf8Bytes \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.528 us 0.2016 us 0.2321 us 1.565 us 1.099 us 1.852 us 1.00 0.00 0.0393 - - 256 B
SerializeToStream \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.983 us 0.1871 us 0.2155 us 2.037 us 1.483 us 2.328 us 1.01 0.12 0.0202 - - 144 B
SerializeToStream \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.982 us 0.1955 us 0.2252 us 2.059 us 1.504 us 2.329 us 1.00 0.00 0.0168 - - 144 B

MyEventsListerViewModel

Method Toolchain Mean Error StdDev Median Min Max Ratio RatioSD Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
DeserializeFromString \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.370 ms 0.2294 ms 0.2642 ms 1.361 ms 0.9599 ms 1.717 ms 1.06 0.23 20.4082 5.1020 - 143.24 KB
DeserializeFromString \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.310 ms 0.1808 ms 0.2082 ms 1.333 ms 0.8968 ms 1.717 ms 1.00 0.00 18.4049 6.1350 - 143.24 KB
DeserializeFromUtf8Bytes \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.169 ms 0.2172 ms 0.2502 ms 1.174 ms 0.8294 ms 1.646 ms 1.04 0.29 11.3636 - - 70.46 KB
DeserializeFromUtf8Bytes \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.164 ms 0.1830 ms 0.2107 ms 1.164 ms 0.6536 ms 1.440 ms 1.00 0.00 10.7143 3.5714 - 70.46 KB
DeserializeFromStream \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.487 ms 0.1170 ms 0.1348 ms 1.530 ms 1.2423 ms 1.723 ms 1.08 0.18 6.1350 - - 70.53 KB
DeserializeFromStream \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 1.399 ms 0.1383 ms 0.1593 ms 1.381 ms 1.1698 ms 1.654 ms 1.00 0.00 6.0976 - - 70.53 KB
Method Toolchain Mean Error StdDev Median Min Max Ratio RatioSD Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
SerializeToString \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.475 ms 0.1630 ms 0.1877 ms 2.504 ms 2.022 ms 2.700 ms 1.19 0.32 44.6429 44.6429 44.6429 382.84 KB
SerializeToString \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.186 ms 0.3806 ms 0.4383 ms 2.242 ms 1.331 ms 3.111 ms 1.00 0.00 39.0625 39.0625 39.0625 382.36 KB
SerializeToUtf8Bytes \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.228 ms 0.1592 ms 0.1834 ms 2.279 ms 1.837 ms 2.534 ms 0.99 0.11 44.6429 8.9286 - 310.07 KB
SerializeToUtf8Bytes \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.253 ms 0.1426 ms 0.1642 ms 2.271 ms 1.929 ms 2.466 ms 1.00 0.00 46.8750 7.8125 - 309.86 KB
SerializeToStream \corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.211 ms 0.1738 ms 0.2002 ms 2.237 ms 1.850 ms 2.599 ms 1.12 0.19 35.7143 - - 237.31 KB
SerializeToStream \upstream\corefx\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe 2.014 ms 0.2553 ms 0.2939 ms 2.110 ms 1.377 ms 2.349 ms 1.00 0.00 34.7222 - - 237.31 KB

@YohDeadfall
Copy link
Copy Markdown
Contributor Author

Does it makes sense to add reflection emit strategy in this PR? It's to implement field support.

@ahsonkhan
Copy link
Copy Markdown

Does it makes sense to add reflection emit strategy in this PR? It's to implement field support.

I would add it separately, in a new PR on top of this.

@YohDeadfall, thanks for getting the perf numbers. I am wondering what's causing the 20-40% regression on certain cases. I would have thought ToString and ToBytes to behave the same way in terms of perf, so the fact that they don't might point to perf results not being consistent.

@ahsonkhan
Copy link
Copy Markdown

@ViktorHofer, @safern do you know if something's up with the ubuntu leg - Ubuntu.1604.Arm64.Open-arm64:
https://mc.dot.net/#/user/dotnet-bot/pr~2Fdotnet~2Fcorefx~2Frefs~2Fpull~2F36506~2Fmerge/test~2Ffunctional~2Fcli~2Finnerloop~2F/20190519.5

A few unrelated tests keeping failing due to timeout (but only for that particular leg). For example - System.Reflection.Tests:
https://mc.dot.net/#/user/dotnet-bot/pr~2Fdotnet~2Fcorefx~2Frefs~2Fpull~2F36506~2Fmerge/test~2Ffunctional~2Fcli~2Finnerloop~2F/20190519.5/workItem/System.Reflection.Tests/wilogs

Ubuntu.1604.Arm64.Open-arm64:Release
Details from Job 3c4164e7-e572-43dc-b7ed-1282f0bd215b
ExitCode: 999 
Ran on Machine: DDARM64S-028 
Get Repro environment 
Console 
 Executed on DDARM64S-028 using docker image mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-helix-arm64v8-b049512-20190321153539
running $HELIX_CORRELATION_PAYLOAD/scripts/ec9b3d38c3b74169a5828e1618fc03d3/execute.sh in /home/helixbot/dotnetbuild/work/3c4164e7-e572-43dc-b7ed-1282f0bd215b/Work/1dc3639e-f10b-4191-8662-722251e07533/Exec max 900 seconds

@ahsonkhan
Copy link
Copy Markdown

ahsonkhan commented May 19, 2019

I am wondering what's causing the 20-40% regression on certain cases. I would have thought ToString and ToBytes to behave the same way in terms of perf, so the fact that they don't might point to perf results not being consistent.

I re-tried running the benchmarks and it looks like the performance is reasonable with no noticeable regression. I commented out some of the config that reduces accuracy in the interest of test execution time:
https://github.com/dotnet/performance/blob/778aa84d99344fcdf73b8c8cff3ff6dee9e5abf9/src/harness/BenchmarkDotNet.Extensions/RecommendedConfig.cs#L17-L20

IndexViewModel

BenchmarkDotNet=v0.11.3.1003-nightly, OS=Windows 10.0.18362
Intel Core i7-6700 CPU 3.40GHz (Skylake), 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=3.0.100-preview4-010907
  [Host]     : .NET Core 3.0.0-preview6-27629-07 (CoreCLR 4.6.27624.71, CoreFX 4.700.19.22902), 64bit RyuJIT
  Job-BMHKSV : .NET Core ? (CoreCLR 3.0.19.26472, CoreFX 4.700.19.26901), 64bit RyuJIT

Runtime=Core  Toolchain=CoreRun  

Before:

Method Mean Error StdDev Median Min Max Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
DeserializeFromString 53.20 us 0.5569 us 0.4650 us 53.26 us 52.67 us 54.38 us 8.3008 1.0376 - 34.14 KB
DeserializeFromUtf8Bytes 48.68 us 0.8121 us 0.7596 us 48.54 us 47.79 us 50.33 us 5.3101 - - 21.85 KB
DeserializeFromStream 49.86 us 0.9864 us 1.0129 us 49.77 us 48.87 us 52.41 us 5.3101 - - 21.92 KB

After:

Method Mean Error StdDev Median Min Max Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
DeserializeFromString 54.97 us 1.6263 us 1.4417 us 54.46 us 53.47 us 58.98 us 8.3008 1.0376 - 34.14 KB
DeserializeFromUtf8Bytes 47.92 us 0.6944 us 0.6155 us 47.74 us 46.84 us 49.11 us 5.3101 - - 21.85 KB
DeserializeFromStream 50.36 us 0.4107 us 0.3430 us 50.36 us 49.76 us 50.82 us 5.3101 - - 21.92 KB

Before:

Method Mean Error StdDev Median Min Max Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
SerializeToString 39.26 us 0.6044 us 0.5653 us 39.19 us 38.65 us 40.48 us 6.0425 - - 25568 B
SerializeToUtf8Bytes 36.71 us 0.8467 us 0.7920 us 36.38 us 35.85 us 38.76 us 3.0518 - - 13016 B
SerializeToStream 34.84 us 0.5173 us 0.4319 us 34.80 us 34.27 us 35.82 us 0.0610 - - 432 B

After:

Method Mean Error StdDev Median Min Max Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
SerializeToString 39.60 us 0.6869 us 0.6090 us 39.47 us 38.69 us 41.07 us 6.0425 - - 25568 B
SerializeToUtf8Bytes 37.43 us 0.4864 us 0.4550 us 37.37 us 36.78 us 38.33 us 3.0518 - - 13016 B
SerializeToStream 35.93 us 0.6962 us 0.9294 us 35.61 us 34.98 us 37.97 us 0.0610 - - 432 B

@ahsonkhan ahsonkhan merged commit d70ba24 into dotnet:master May 20, 2019
@ViktorHofer
Copy link
Copy Markdown
Member

@ViktorHofer, @safern do you know if something's up with the ubuntu leg - Ubuntu.1604.Arm64.Open-arm64:

Yes we are currently hitting frequent issues with docker images on arm64, @MattGal is rolling out a potential fix soon.

@YohDeadfall YohDeadfall deleted the struct-serialization branch May 20, 2019 06:33
@MattGal
Copy link
Copy Markdown
Member

MattGal commented May 20, 2019

One note; Arm64 is a different setup path (since they aren't VMs) but once we solve this on AMD64 we should have a good idea how to deal with it for ARM64 as well.

picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Added value type serialization support

* Fixed coding style issue


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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S.T.J.JsonSerializer does not serialize value tuples

10 participants