top | item 6633368

(no title)

visural | 12 years ago

While the benchmark shows that there is a measurable difference between using getters/setters and NOT using them. I have doubts this would make a great deal of difference in application level code. The performance bottlenecks are most likely going to be IO or calls, or if the app is CPU bound, actual calculation code.

I'd be willing to bet the percentage of time spent in getters and setters on the call stack is pretty insignificant.

discuss

order

nextw33k|12 years ago

That is a very desktop application view. As programmers we should consider CPU cycles equating to battery life.

Whilst it might not have a big impact, if every programmer thought pragmatically about energy usage then the environment as a whole would benefit.

lesiki|12 years ago

I think the point is that whatever slowdown the use of Accessor pattern introduces will actually be a lot smaller than 2X, which is useful information when deciding whether to discard the great benefits of using the Accessor pattern that others have mentioned.