When should and shouldn't you break away from OOP for speed/performance?

android, java, oop, performance

Solution

Build it to be maintainable, and then hack it to be faster.

If you start with the hack - which you might not have needed - maintenance is usually a nightmare.

Problem

In their developer articles for Android, Google states that you should usually declare public variables rather than private ones with getters and setters to enhance performance on embedded devices (I suppose function calls are more expensive than just writing to an address). I was wondering - to what extent should performance be sacrificed to stick to the OOP paradigm? And in what other cases does optimisation mean a break-away from 'good' coding practices?

Original source