Feb-22-2017, 08:00 AM
(Feb-22-2017, 01:44 AM)Skaperen Wrote: it might come down to the CPU cost of.attribute
vs a plain local variable. given thatself
is a local variable there is already the cost of accessingself
. now add on the cost of accessing an attribute within it ... unless python does any performance optimizing forself
specifically (because it is so commonly used) or for repeating expressions.
It is highly likely that the compiler recognizes the pattern and optimizes around it (assuming it is worth it). Using your own variable may make it less obvious and prevent better optimizations.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Your one-stop place for all your GIMP needs: gimp-forum.net