This is a migrated thread and some comments may be shown as answers.

Performance difference between ?? and IsNull?

1 Answer 53 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Anil
Top achievements
Rank 1
Anil asked on 08 Nov 2018, 05:06 PM
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

Sort by
0
Ivan Hristov
Telerik team
answered on 13 Nov 2018, 10:31 AM
Hello Anil,

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.

Regards,
Ivan Hristov
Progress Telerik
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? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Anil
Top achievements
Rank 1
Answers by
Ivan Hristov
Telerik team
Share this question
or