Is there a performance degradation when we ALWAYS use nullable value types instead of value types?
It's the price of copying the entire value type: pretty much nil for things like integers, GUID's, etc., but it's large if you're constantly copying 512-KB value types (which you shouldn't be having in the first place) inside a tight loop.
As Mitch Wheat pointed about above, no, you should not worry about this. I'm going to give you the short answer reason now, and later I'm going to help you discover more about what you're asking:
Write your code to be correct. Profile after writing so that you find the points that are causing you grief.
When you have code that constantly uses Nullable and you have performance reasons and you profile it and you can't find the problem yourself, then come ask us how to make it faster. But no, the overhead of using Nullable is for all intents and purposes not degrading.
Now, having read all those pages, I hope you feel more enlightened.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With