Re: [pygame] 2D vector class
by Richard Jones other posts by this author
Aug 22 2006 3:15PM messages near this date
Re: [pygame] 2D vector class
|
Re: [pygame] 2D vector class
On Wednesday 23 August 2006 02:57, Lenard Lindstrom wrote:
> ... The instance dict is searched only if one is not
> found. So having a descriptor reduces the search time. And a slot
> descriptor does not do a dict lookup. So slots should be faster,
> though I have not confirmed it.
The function call overhead (for the getter) is much greater than the fallback
to a dict lookup (which is insanely fast). We did some optimisation of
function calls at the Need For Speed sprint in Iceland, but I only managed to
squeeze out a 5% improvement (aka "noise") and others didn't fare much
better. I'd be interested to see some *actual* numbers, but I'd be surprised
if slots are faster than regular attributes. Unless there's been some
slot-specific optimisation I've missed along the way :)
Richard
Thread:
Scott Nelson
Marius Gedminas
Brian Fisher
Scott Nelson
Brian Fisher
Alex Holkner
Brian Fisher
Brian Fisher
Ethan Glasser-Camp
Matthias Baas
Alex Holkner
Brian Fisher
Marius Gedminas
Brian Fisher
Lenard Lindstrom
Richard Jones
Richard Jones
Matthias Baas
Greg Ewing
Richard Jones
Greg Ewing
Ethan Glasser-Camp
|