~/talk

High Performance JSON Serialization With Code Generation on C# 11 and .NET 7.0

Talkat JetBrains .NET Day Online 2023 · on Tuesday, 2023-09-26· [dotnet]
links:none on file
slides:none on file

Compares Newtonsoft.Json to System.Text.Json on .NET 7 and C# 11, showing UTF‑8 native parsing avoids the UTF‑16 conversion cost and slashes memory from ~22 MB to ~4–5 MB for 10,000 objects; using JsonElement yields ~222 bytes total allocation and ~4 ms to find the 5,000th item, while a streaming Utf8JsonReader implementation drops allocations to ~50 bytes. Demonstrates source generators (Corvus.JsonSchema and SDK generators) that remove reflection cold‑start costs and emit fast serializers that work and scale.

AI-written summary · about

  1. 0:00Introduction to JSON perf
  2. 1:48Problems with Newtonsoft JSON
  3. 8:06Newtonsoft JSON benchmarking
  4. 20:24System.Text.JSON overview
  5. 28:54System.Text.JSON benchmarks
  6. 33:21JSON element API performance
  7. 40:44Deep dive into JSON element
  8. 48:17Reflection vs code generation
  9. 55:10Source generators in .NET
  10. 1:02:53Advanced generation techniques
  11. 1:11:06Conclusion and Q&A
  12. 1:15:01Environmental impact discussion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.