~/talk

The Fastest .NET Dictionary… With F#

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

A custom F# dictionary claims faster reads than System.Collections.Generic.Dictionary and FrozenDictionary by iterative engineering: using BenchmarkDotNet, dotTrace, vTune to guide changes, eliminating allocations via EqualityComparer.GetHashCode and EqualityComparer.Equals, replacing mod with Fibonacci hashing (power‑of‑two buckets), moving from separate chaining to open addressing, then a byte list (embedded buckets + byte "next" offsets) and finally a shift‑and‑mask uniquifier that yields near‑perfect hashing for strings and beats FrozenDictionary for many string workloads.

AI-written summary · about

  1. 0:00Introduction
  2. 3:12Benchmarking .NET collections
  3. 6:26Starting the experiment
  4. 7:29Naive dictionary flaws
  5. 11:18Eliminating allocations
  6. 14:08Fibonacci hashing
  7. 18:03String keys performance
  8. 22:21Cache misses reduction
  9. 26:18Linear probing problems
  10. 29:37Robin Hood hashing
  11. 31:21Byte list approach
  12. 34:56Frozen dictionary race
  13. 36:41Struct of arrays
  14. 39:53Perfect hash functions
  15. 49:56Next steps for .NET
  16. 51:42Optimization lessons
  17. 54:49Q&A
~/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.