~/talk

Writing Allocation Free Code in C#

Talkat Dotnetos Conference 2019 · 2019-10-10..10-11· [web-performance]
slides:none on file

Argues that cutting allocations improves throughput more than microfast algorithms and shows exactly how using C# 7.0/7.2 features and libraries avoids heap churn: demos use ref return and ref locals to mutate array elements in place, ref readonly and readonly structs to avoid defensive copies, and Span<T> / System.Memory plus ValueTask to process slices allocation free. Uses Rider/Resharper Heap Allocation Viewer and unit tests that assert allocation‑free execution and run green, and notes Span has portable and fast runtime implementations.

AI-written summary · about

  1. 0:00Introduction
  2. 1:22Why
  3. 1:52Throughput
  4. 5:13Reducing allocations
  5. 8:11Reference types vs value types
  6. 11:43Closures
  7. 14:38Solutions
  8. 17:32Reference Semantics
  9. 19:53Passing by Reference Value Types
  10. 21:20RefReturn
  11. 23:57RefLocal
  12. 28:52RefReadOnly
  13. 33:42InRef
  14. 36:42ReadOnly struct
  15. 39:17Ref Strutt
  16. 40:27Span of T
  17. 42:14How does it work
  18. 43:10Portable version
  19. 44:20Span
~/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.