Skip to content

Commit

Permalink
Added serializing object property to JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
svick committed Oct 13, 2019
1 parent 8f782f8 commit 7ffcc2c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public async Task SerializeToStream()
await JsonSerializer.SerializeAsync(_memoryStream, _value);
}

[BenchmarkCategory(Categories.CoreFX, Categories.JSON)]
[Benchmark]
public string SerializeObjectProperty() => JsonSerializer.Serialize(new { Prop = (object)_value });

[GlobalCleanup]
public void Cleanup() => _memoryStream.Dispose();
}
Expand Down

0 comments on commit 7ffcc2c

Please sign in to comment.