Hello all. For the past couple of days I have been implementing a series of particle animations and through it, learned a lot about how to make a pyglet program achieve a nice speed.
However, today I decided to port my code over to HTML5's canvas tag and see what would happen. I wasnt entirely certain that it would be *that* great since to get 60FPS in pyglet I had do some work in C. to my surprise, Canvas ran faster than pyglet. in pyglet I had to have 2500 particles to get 60fps, however in Canvas I could scale it up to 7500 particles and get a solid and fluid 60FPS. I did a lot of work in pyglet making it scale that high. I know that one of my main things slowing down pyglet was calculating new coordinates, but after I implemented that in C, it took a mere . 001 seconds to calculate the new coordinates of ALL the points. So the main slow down is now Rabbyt drawing the points (and Rabbyt is about 5x faster than Pyglet's sprites in this instance). The points are currently png images of circles in Rabbyt Sprites. I got about a 10% speed decrease when I moved from a vector list of GL_POINTS to using a png image w/ Rabbyt. but i can scale the images easily making one point bigger than the rest, something you cant do with a vertex list full of GL_POINTS. and 10% doesnt at all make it come close to HTML5's Canvas. Now when I run it in HTML5 canvas, I still use png images because it gives about a 40% speed gain then having the canvas calculate arcs. Anyways, I am just horribly dissappointed by Pyglet. I used it for about a year and always just excused some of its performance lags because it was a scripting language. but a scripting language in a browser kicks Pyglet's *$$ Also one should note that when I run it in chrome it runs at a stable 60FPS, but in FireFox 3.5, it runs at about 2FPS. So the browser does make a difference. Also you should note that straight up w/o my C implementation to calculate coords Pyglet gets about 11 FPS on 2500, and with standard pyglet sprites, about 8 FPS. the script isnt complicated at all so its not like there is a black hole where i messed up the coding which is sucking up space, it is all Pyglet's slow render speed. I profiled my python code extensively and the rendering is the slowest part. So I just wanted to get some of your thoughts on this. I know that HTML Canvas is just 2D, and pyglet can do a lot more, but still, javascript won in a performance contest against python.. and I find that both sad and frightening that python is still so slow, at least at rendering stuff. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
