C# as a system language
summary
Implements a Redis clone in C# in under 100 lines, runs on an Amazon ARM 16-core 64GB VM and hits ~1M qps with naive code then 1.6M after using PipeReader/PipeWriter, 1.8M when removing string allocations with Span<T>/owned buffers and can reach ~2.5M when pushed further; uses unsafe pointers, array pools, ConcurrentDictionary for storage, native memory with GC fallback, vector intrinsics and even Linux io_uring via a NuGet package to minimize syscalls, demonstrating practical system-level performance and tradeoffs.
AI-written summary · about
chapters (12)
- 0:00C# as system language
- 1:12Why use C# for systems
- 3:20Managed languages for systems
- 5:29.NET performance over time
- 6:36Building Redis clone in C#
- 9:44Optimizing Redis clone
- 14:478M queries per second
- 16:12I/O bottlenecks with io_uring
- 18:00Memory management in C#
- 20:26High-level vs low-level code
- 22:11Iterative optimization
- 23:34Code example and JIT optimizations
related talks
57mPushing C# to the limit
01h 04mTurbocharged: Writing High-Performance C# and .NET Code
01h 14mTurbocharged: Writing High-performance C# and .NET code
56mState of the .NET Performance
01h 09mPatterns for high-performance C#
52mPerformance features in C#
01h 01mTurbocharged: Writing High-Performance C# and .NET Code
57mTrying to learn C#
