Another thing that might help would be to optionally memoize some or all of the computations produced by a sprite rotation?
On Wednesday, March 30, 2016 at 2:04:37 AM UTC-4, Benjamin Moran wrote: > > I just tried a simple hack: > > A self._prev_rotation attribute is added to the sprite. The rotation > values (sr, cr) are also saved as self._cr and self._sr. > If the self._prev_rotation is != to self._rotation, then these values are > recalculated. If the rotation value has not changed, > then the previously saved attributes are used. This saves a bit of time > for sprites that are rotated, but only move on the x or y axis, because > three calls to the math module are skipped. > > Benchmark results: > Rotate Sprite only: 8.33312895099516 > Move Sprite only: 4.476478230004432 > Move Rotated Sprite: 6.912901834002696 > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscr...@googlegroups.com. To post to this group, send email to pyglet-users@googlegroups.com. Visit this group at https://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.