views:

55

answers:

1

Is there a noticeable performance difference when using fields instead of auto properties? What about if I'm deserializing an array of say, 1000 JSON objects with 5 properties each?

My iPhone domain model is basically a copy of the DTOs my web app uses for serialization to javascript. They all use auto properties by habit. I'm concerned that I'm wasting CPU cycles using them in MonoTouch though.

+3  A: 

I blogged about this very topic and Miguel himself commented on it saying that simple properties are inlined. My blog post suggested that properties are slower than fields. This caught the interest of the MonoTouch team and they took a look at it (I sent them my benchmark app to play with) and they disagreed with me, saying other factors were involved. I tend to believe them, so I do think using properties is just fine.

Matt Greer
I did a search on google but never came across your page. Thanks!
ifwdev