I get similar behavior (details below). Using Group() gives me the same speed as OrderedGroup(0).
# note: pyo means python -O; tests on an Intel MacBookPro, OS 10.5 # group = None: # python label_speed.py -- 1400 fps # pyo label_speed.py -- 2340 fps # group = pyglet.graphics.OrderedGroup(0): # python label_speed.py -- 40 fps # pyo label_speed.py -- 84 fps # group = pyglet.graphics.Group(): # python label_speed.py -- 40 fps # pyo label_speed.py -- 84 fps - Bruce On Tue, Jun 23, 2009 at 4:50 AM, Nicolas Rougier <[email protected]>wrote: > > > Hi all, > > I tried to use labels with ordered groups and it seems to dramatically > decrease performances. Can anyone confirm ? Here is a quick test, just > replace "group" with None for fast, in my case, when group is an > OrderedGroup, I get around 50 fps while with no group I get around > 1600 fps. > > Nicolas > > ---- > > import pyglet > import random > > window = pyglet.window.Window(512,512,vsync=0) > fps_display = pyglet.clock.ClockDisplay() > pyglet.clock.schedule(lambda dt: None) > batch = pyglet.graphics.Batch() > group = pyglet.graphics.OrderedGroup(0) > group = None > > for i in range(100): > x = int(random.random()*window.width) > y = int(random.random()*window.height) > label = pyglet.text.Label('Hello world !', > x=x,y=y,batch=batch,group=group) > > @window.event > def on_draw(): > window.clear() > batch.draw() > fps_display.draw() > pyglet.app.run() > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
