.NET 6 vs .NET 5: up to 40% speedup!

.NET 5 output is on the left side, .NET 6 is on the right side
  • Tests producing 20M+ operations/s (#1, #3) are mainly constrained by Fusion’s logic, Castle.DynamicProxy, and overall, it’s ~ mostly a cache key computation and lookup logic. Almost every iteration ends up with a cache hit there.
  • Tests producing <1M operations/s are constrained by either EF & SQL Server (#2, #5) or ASP.NET Core (#4 — it’s ~ the same as #5, but relying on Fusion’s caching features).
  • Caching / tight loop tests get up to 30% speedup
  • Test #4, which basically adds Fusion cache to a regular web API, gets 15% speedup with .NET 6
  • “Typical” HTTP pipeline test (HttpClient hitting ASP.NET Core controller that hosts a CRUD style EF Core service) gets ~ 4.5% speedup.
Spreadsheet w/ more data: https://docs.google.com/spreadsheets/d/1-zs6JMtsgQ3mll4whSDKl2T7l38ob4cW9trZNpEWaz4/edit?usp=sharing
  • Top tests mostly compute cache keys, hash them, acquire async locks, and run ConcurrentDictionary lookups
  • Bottom tests actually run SQL commands — mostly SELECT -s fetching a single row.
  • +30–40% speed on tight loops & cache-friendly logic
  • +15% for an average code that doesn’t depend on networking & IO
  • +5% for a typical web service that mostly depends on networking & IO.

Creator of https://github.com/servicetitan/Stl.Fusion , ex-CTO @ ServiceTitan.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Azure Functions and Docker

NodeJS app building and publishing to the registry with docker

ENCANVAS announces the launch of HyperDrive™ Universal Data Plug

Lego vs SoC, Apple M1 + MT8195, Microservices and Big Data Model

Integrate JWT in SpringBoot to realize Token verification (Additional notes)

How we built a highly scalable distributed state machine

My experiences at coding bootcamps

Bridging 3D assets for the metaverse through the $STYLE PROTOCOL:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alex Yakunin

Alex Yakunin

Creator of https://github.com/servicetitan/Stl.Fusion , ex-CTO @ ServiceTitan.com

More from Medium

C# 6 Performance Tricks

Microsoft Orleans — Long running CPU bound work

How I Upgrade my Code-Style of MediatR Pipeline using .NET 6

Mastering at Source Generators