top | item 31483880

(no title)

legorobot | 3 years ago

I haven't thought about it that way! I've not hit the GC as a performance wall when it comes to accessing nullable DB values yet. Thanks for the insight.

discuss

order

throwaway894345|3 years ago

It's generally useful, not just in SQL. Any time you have a type that could be multiple things, you have to choose between a reference-based implementation (e.g., interfaces) or a tagged struct (a struct with a flag field that tells you what its runtime type). The tagged struct version is guaranteed not to allocate, while the interface version very likely will. Most of the time it will only matter if you're in a tight loop.