Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

performance overhead for setters and getters in Android?

 
x kevik
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I was learning Java standard edition, getter and setter functions were often used to hide variables and to reduce direct access to them. I have been told by several sources that in Android you should not use these functions and only modify the variables directly. The reason is that there is a performance loss due to overhead when using getters and setters is used in Android. Resulting in more memory use and slowing down the system.

Is there any truth to this? and if there is, why the performance loss for using getter and setter?
 
Will Zelan
Ranch Hand
Posts: 56
Flex Python Windows Vista
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think so. I really really don't think so.
If you're concerned about any possible performance or memory problem associated with getters and setters you'll probably want to write C++ code in the NDK.
Seriously though, you'll probably have a bigger performance hit showing something on the screen.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic