Since the null-coalescing operator (??) and the IsNull function appear to do the same thing, I was wondering if there is a performance benefit of using one over the other.
1 Answer, 1 is accepted
answered on 13 Nov 2018, 10:31 AM
The null-coalescing operator ?? should perform a bit faster than the IsNull function, because the functions are resolved via method attributes, which involves reflection, while the ?? operator instantiates a new binary function and passes the operands to it. However, I expect the execution time for both to affect the performance by a very small factor, because the resource-consuming tasks are mainly performed during the process of building the processing tree and rendering the document, so it's much to your preference to use one or another.
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items