These are chat archives for pixijs/pixi.js

11th
Oct 2016
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 08:56
Is there a recommended way of making use of rAF? Turns out the ticker is mainly for movieclips and interactivity
Jaume Tarradas Llort
@bichotll
Oct 11 2016 09:01
hi guys! how is it going? I've noticed that the use of setTimeout (at least on Chrome) makes the browser render long frames?
I created two examples so you guys can review them? :p
I understand that refreshing every 100ms should be less heavy for the CPU?
I've been looking for information around but could not find anything that helped me.
http://jsbin.com/vefejan/edit?html,js,output
http://jsbin.com/hebocuriha/3/edit?html,js,output
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 09:07
because I think, at most, your stage will only update 10x per second (100ms x 10 = 1s.) It is less heavy yes, but there is no surprise here, your stage will be rendered at 10fps.
Jaume Tarradas Llort
@bichotll
Oct 11 2016 09:42
I still don't understand why the long frames
I'm moving the elements to a different position, I'm just moving the elements to a different position without using requestAnimationFrame
@prime-ralph
blob
here the log
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 10:07
You're calling your animate function only 10x per second if I'm right. This is not about your CPU being slow or anything at all, even the profile you made says that. It's just that you
made it run at 10 fps. There's no such thing as long frames in here at all.
Jaume Tarradas Llort
@bichotll
Oct 11 2016 10:11
I'm starting to understand the report heh
blob
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 10:12
Well, if there's long frames in there, it's something you imposed my friend. :D
Jaume Tarradas Llort
@bichotll
Oct 11 2016 10:12
so I understand that the report is telling me that I'm refreshing the page every ~10fps?
gotcha heh
*edited I thought chrome report would highlight the long frame if there was a problem, but that's clearly not the scenario heh
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 10:13
Your setInterval duration of 100ms basically means that.
Jaume Tarradas Llort
@bichotll
Oct 11 2016 10:13
cool stuff heh
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 10:13
Is there a reason why you want to use setInterval?
Jaume Tarradas Llort
@bichotll
Oct 11 2016 10:13
tnx man :p
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 10:14
I'm happy if it helped.
Jaume Tarradas Llort
@bichotll
Oct 11 2016 10:14
sure u did heh :p
On my app I have a progress bar depending on the time that a video player is giving, which is every 40ms
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 10:15
I'm actually also looking for a performant means of doing an rAF too.
Jaume Tarradas Llort
@bichotll
Oct 11 2016 10:15
that's why I got scared that pixi was giving long frames if I were re-rendering every time the secondsTime was changing
xplain, I'll try to help heh
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 10:19
My problem is that I'm just rendering one sprite and calling requestAnimationFrame normally, and it lags so much
I'm trying to track down why. I'm using a 4800 by 2700 canvas, sprites from SVGs, and an uninhibited rAF call haha
Jaume Tarradas Llort
@bichotll
Oct 11 2016 10:19
just a tip, try to reproduce it on jsbin or so? so that will isolate the problem n u can share the issue if needed ;)
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 10:21
blob
Now that's a memory leak if I've ever seen one. I'm just tracking it down, so I'm cool atm
Jaume Tarradas Llort
@bichotll
Oct 11 2016 10:22
if that helps I'm coding a Ember app (not my chose)...it's slow/heavy af...n so far I can say that's not memory leak problem hah
jokes apart, good luck hah
Ralph Sto. Domingo
@ralphstodomingo
Oct 11 2016 10:24
I'm from Angular, so I don't know how to respond to that :D but yeah thanks
It's the canvas size. Another lesson learned
Jaume Tarradas Llort
@bichotll
Oct 11 2016 10:33
ah, yeap, I read about that heh
well, if any time u wanna upgrade, go for React heh
Chad Engler
@englercj
Oct 11 2016 14:48
an empty requestAnimationFrame loop with no code at all can cause a sawtooth pattern, doesn't mean there is a leak. There is only a leak if after GC the bottom of the sawtooth gets higher each time.