in reply to Re: Re: Micro optimisations can pay off, and needn't be a maintenance problem
in thread Micro optimisations can pay off, and needn't be a maintenance problem

Well, my analysis in this case should be taken with a salt lick, but breaking it out into the original (overall) benchmark followed by one each create/set and create/get shows that the "get" case is roughly 33% (up to 40%) faster than the "set" case. It also shows that the "set" gets (2%-3%) more of an improvement out of this optimization than the "get" does.

Breaking it out further, and accessing the previously-set $thing1 through $thing4 rather than creating a new object each iteration, I see that the individual "get" and "set" are actually about 37% faster.

So object creation does factor in, and getters are faster. It's still "only" a 37% improvement, rather than sixfold, but it's not a unilateral 37%.