~/talk

Using Pointers and ref Structs for Low-Level C# Optimization

TalkinRussianat DotNext 2025 · 2025-09-18..09-19· [dotnet]
links:none on file
slides:none on file

Covers low-level C# performance techniques using the ref modifier, managed pointers, and ref structs such as Span<T>. Explains how managed-pointer arithmetic is implemented in C#, its capabilities and pitfalls, why Span<T> was introduced, and examines runtime source code to show how dotnet/runtime authors use ref for library-level optimizations. Also describes using Span<T> to speed up text and binary processing and new ref-struct features added in .NET 9.0.

AI-written summary · about

  1. 0:00Introduction
  2. 1:25Ref modifier history
  3. 3:11Managed pointers basics
  4. 7:02Returning refs from functions
  5. 11:37Unsafe class risks
  6. 22:27Ref structs intro
  7. 24:56Span benefits
  8. 31:02Writable spans
  9. 34:35SpanStringBuilder optimization
  10. 38:54Binary data with spans
  11. 42:23C# 13 ref struct improvements
  12. 48:30Memory<T> use cases
  13. 51:45Modifying literal strings
  14. 54:19Summary and best practices
  15. 55:42Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.