varkor / pokengine

An online Pokémon battle system for the web
http://varkor.com/pokengine/battle/
MIT License
54 stars 11 forks source link

Performance issues #78

Open varkor opened 10 years ago

varkor commented 10 years ago

Especially in double battles, my computer struggled to achieve a constant 60 frames per second, although this should be easily attainable. I suspect it's something to do with a multitude of new Displays being created unnecessarily. Please investigate this.

varkor commented 9 years ago

Preventing Battle from drawing achieves a much better framerate, although it does not eliminate the occasional spikes entirely (which is very frustrating). When sprites are actually drawn, though, the framerate oscillates between around 50 fps and 40 fps, over the course of a few seconds. This seems very dubious and I suspect there is some inefficient time-based code somewhere that has been overlooked. This is an important issue.

varkor commented 9 years ago

Weather effects are also a major factor in reducing the frame-rate.

varkor commented 9 years ago

The _ function seems to be somewhat responsible. At least when it is replaced with something else temporarily, although the usual, baseline performance issues remain, the sudden drop to a constant, much lower framerate (which is still very confusing—may be related to Chrome's "Optimized too many times" warning?), seems to disappear. Note that Firefox does not suffer from the sudden drop, just the constant baseline.