These are chat archives for pixijs/pixi.js

19th
Jul 2017
Mick Dekkers
@mickdekkers
Jul 19 2017 12:48
Hi all, my Pixi app is running pretty slow (~15-30 fps) and when I look at the chrome profiler I can see that my update function is getting called by multiple times before most renders (the one below Ticker._tick): https://puu.sh/wNyO3/3a38a6ec22.png
Am I misusing the ticker somehow?
My update function prepares the various sprites on the screen for a render (updates their position, handles interaction, etc.), so it should only be called once per animation frame; anything more is just a waste of CPU
Mick Dekkers
@mickdekkers
Jul 19 2017 12:55
This is my update function (truncated):
app.ticker.add(deltaTime => {
  particles.forEach(particle => particle.update(deltaTime))
})
Dave Moore
@themoonrat
Jul 19 2017 18:09
Isn't that creating a new anonymous function every tick?
(just took a quick glance, might be wrong, but it's why i always stick to simple for loops in games)
zurcacielos
@zurcacielos
Jul 19 2017 18:39