Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Fix ITextBufferWriter performance regression: ArrayFormatter.GetSpan should not go through GetMemory #2255

Merged
merged 1 commit into from
May 3, 2018

Conversation

ahsonkhan
Copy link
Member

@ahsonkhan ahsonkhan commented May 3, 2018

Regression observed in JsonWriter performance test: #2254

The following PR caused the regression: #2047 / 4bf5f6a - Jan 17, 2018

Was there a particular reason we went through Memory<byte> to get the span? I am now getting the Span directly. If this is correct, we should make similar changes to all implementations of ITextBufferWriter (for example BufferWriterFormatter).

This change improves JsonWriter performance by roughly 70% (before - 115 ms, after - 67 ms).

cc @pakrym, @KrzysztofCwalina, @davidfowl, @JeremyKuhne

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.

2 participants