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 pyglet-users+unsubscr...@googlegroups.com.
To post to this group, send email to pyglet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to