3 ms·
Instead of a field, you get a field and two methods. It's more IL, more metadata, etc. Maybe when the JIT is all done it's eliminated, but it'll cost more to JI
by MichaelGG 9y ago
Instead of a field, you get a field and two methods. It's more IL, more metadata, etc. Maybe when the JIT is all done it's eliminated, but it'll cost more to JIT.
Though I doubt this makes a ton of real world impact, performance wise. Stripping names would do more to shrink the .Net code.
- taspeotis 9y ago> Instead of a field, you get a field and two methods And if you wanted a publically read-only/privately mutable value without properties you'd have to write ... a field and one method. Possibly two methods if you wanted some shared validation code everywhere you assign the field. Like I said, in practice, it's the same. If you have some case where three vs. two members makes a difference you're in pathological case territory.