sry i forgot... to avoid a reverse() call you can do a reverse xrange: rows = [data[i:i+abs(data_pitch)] for i in xrange(len (self._current_data)-abs(data_pitch), -1, -abs(data_pitch))]
On Nov 21, 1:28 am, josch <[EMAIL PROTECTED]> wrote: > while doing research for this > problem:http://groups.google.com/group/pyglet-users/t/8c22362715cbade4 > i found out that instead of writing: > > rows = re.findall('.' * abs(pitch), data, re.DOTALL) > > its MUCH faster (jump from 4fps to 20fps) to do: > > rows = [data[i:i+abs(data_pitch)] for i in xrange(0, len > (self._current_data), abs(data_pitch))] > > the memmove and reverse() calls are quite fast compared to this one. > there are some occasions in image/__init__.py where the re module is > used for string splitting and where using slicing seems to be faster. > > hope this helps! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
