Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Investigate high exclusive time in MSD.GetNode #5362

Closed
@rynowak

Description

@rynowak

This is sampling data from the LargeJsonApi app using the POST test scenario:
image

The total time spent processing the request was 28s, and 3780ms of exclusive time (own time) was spent in ModelStateDictionary.GetNode(...). This is 13.5% of the app's processing time. https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Abstractions/ModelBinding/ModelStateDictionary.cs#L509

You can see from the trace that new StringSegment and ModelStateNode.GetNode were not inlined, so I immediately suspect string.IndexOfAny which is implemented natively by the runtime. Our search space is generally constrained to dot-separate property names, which means the search text is small, and the number of delimiters we're looking for is 2. This seems like a good candidate for hand-optimizing.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions