.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.

--

--

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