Fast code! By removing all branches!
summary
A migration of Delphi serialization to .NET 2.0 uses run-time code generation and heavy use of delegates and factory-created processors that do all type and transform decisions once and then execute raw method calls, eliminating per-item branching. Reflection is noted as ~1000× slower so custom fast-reflection and removing casts (an unsafe trick that crashes the .NET VM if wrong type) get a 10–20× gain and the final serializer runs about twice as fast as the original Delphi implementation.
AI-written summary · about
chapters (8)
- 0:00Terrible code crime
- 1:06Slow .NET reflection
- 2:34Separating decision logic
- 4:41XML serialization abstraction
- 6:47Object and collection properties
- 8:16Sealed types and collections
- 9:03Generalizing optimization
- 9:48Avoiding code generation
related talks
52mRoad to .NET 6: migration story of hope and despair
46mSupercharging PowerShell with LINQ
01h 02mApplication Performance Optimisation in Practice
59mOptimize for the Cloud – Lightning-speed .NET Container Apps
01h 02mThe performance loop—A practical guide to profiling and benchmarking
32mWhat the game industry taught me about performance
20mWhy we built another framework
01h 31mThe Full Show
