mardi 18 août 2015

Is it better to perform the same calculation multiple times?



When optimizing onDraw of a custom view, I found alot of object allocations in the onDraw method of that library.

What I don't know is if it's more efficient to calculate the same calculation multiple times or allocate one calculation to an object an reuse that object?

I want to hear your opinion about this, since it will be allot of work to change this "property" of the code.

Thanks,

Tim



Aucun commentaire:

Enregistrer un commentaire