Is [CallerMemberName] slow compared to alternatives when implementing INotifyPropertyChanged?

No, the use of [CallerMemberName] is not slower than the upper basic implementation.

This is because, according to this MSDN page,

Caller Info values are emitted as literals into the Intermediate
Language (IL) at compile time

We can check that with any IL disassembler (like ILSpy) : the code for the “SET” operation of the property is compiled exactly the same way :
Decompiled property with CallerMemberName

So no use of Reflection here.

(sample compiled with VS2013)

Leave a Comment