Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasnordqvist committed Nov 9, 2024
1 parent 69dddd7 commit 9a1f0ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FartingUnicorn.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public class Pet
private static Stream _jsonStream = new MemoryStream(Encoding.UTF8.GetBytes(_json));

[Benchmark]
public async Task<UserProfile> Test1()
public async Task<UserProfile> ClassicDeserializeToT()
{
_jsonStream.Seek(0, SeekOrigin.Begin);
return (await JsonSerializer.DeserializeAsync<UserProfile>(_jsonStream))!;
}

[Benchmark]
public async Task<UserProfile> Test2()
public async Task<UserProfile> FartingDeserialization()
{
_jsonStream.Seek(0, SeekOrigin.Begin);
using var json = await JsonDocument.ParseAsync(_jsonStream);
Expand Down

0 comments on commit 9a1f0ac

Please sign in to comment.