Skip to content

Commit

Permalink
add cold benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriktsarpalis committed Jan 27, 2022
1 parent c8273d7 commit 9456abf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public async Task Setup()
[Benchmark]
public T DeserializeFromString() => JsonSerializer.Deserialize<T>(_serialized);

[BenchmarkCategory(Categories.Libraries, Categories.JSON)]
[Benchmark]
public T DeserializeFromStringColdStart() => JsonSerializer.Deserialize<T>(_serialized, new JsonSerializerOptions());

[BenchmarkCategory(Categories.Libraries, Categories.JSON)]
[Benchmark]
public T DeserializeFromUtf8Bytes() => JsonSerializer.Deserialize<T>(_utf8Serialized);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public async Task Setup()
[Benchmark]
public string SerializeToString() => JsonSerializer.Serialize(_value);

[Benchmark]
public string SerializeToStringColdStart() => JsonSerializer.Serialize(_value, new JsonSerializerOptions());

[Benchmark]
public byte[] SerializeToUtf8Bytes() => JsonSerializer.SerializeToUtf8Bytes(_value);

Expand Down

0 comments on commit 9456abf

Please sign in to comment.