This doesn't work with the latest release of pyglet, but I love the heap/priority queue implementation.
Did you try to get this merged into the main pyglet branch in the past? If so, any reaons why it wouldn't be accepted? The heapq module is in the standard library (and pure python), so it would be nice to see the main clock module get a rewrite utilizing it. On Thursday, October 22, 2015 at 1:53:03 PM UTC+9, Leif Theden wrote: > > When I was maintaining my personal pyglet fork with win32 and python3 > compatibility, I rewrote the scheduler to be a bit quicker in most > situations. The standard clock is slow because it is constantly resorting > the scheduled items list. This implementation uses a heap queue to keep > the list 'sorted'. According to my own benchmarks, it is considerably > quicker when dealing with a large number of scheduled events (over 200 or > so...). > > I'm open to suggestions and opinions. Thanks! > > Here is the clock: > https://github.com/bitcraft/pyglet/blob/master/pyglet/clock.py > > Here is the benchmark I used: > > https://github.com/bitcraft/pyglet/blob/master/tests/benchmarks/benchmark_heapq_clock.py > > Here is the 'legacy' clock to use with the benchmark...it is just the > pyglet clock from 1.2 alpha-something: > > https://github.com/bitcraft/pyglet/blob/master/tests/benchmarks/clocklegacy.py > > I'm not sure if this will be a drop-in replacement, but it is a start! > Hope it helps. > > > > On Saturday, October 3, 2015 at 11:15:53 AM UTC-5, Salvakiya wrote: >> >> Is there a way I can avoid using the Pyglet.app.run()? I hate the way >> pyglet schedules events and I tend to run into performance issues quite >> quickly. I was hoping to avoid using them and create my own system for the >> gameloop. >> > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.
