Closed
Bug 1160260
Opened 10 years ago
Closed 9 years ago
Lots of jank from GC pauses on http://agar.io/
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: ted, Unassigned)
Details
Attachments
(2 files)
http://agar.io/ is a neat little multiplayer game, but it's pretty unplayable in Firefox due to GC pauses causing jank. Plays fine in Chrome (release, 42) on the same machine (Windows 7).
I profiled it with the DevTools profiler and it showed GC eating up all the time, a total of like 1.8s (probably not all at once).
In my case, it doesn't seem like there are a lot of GC pauses, but the RequestAnimationFframe takes sometimes over 20ms to complete and the game stutters periodically.
The game is just not smooth on Firefox (with or without e10s), but works very well on Chrome.
Comment 2•9 years ago
|
||
i agree, and work fine on IE too ...
Comment 3•9 years ago
|
||
NI from a random GC person. (Maybe not entirely random, I've been bugging terrence and jonco enough the past few weeks...)
Flags: needinfo?(sphink)
Comment 4•9 years ago
|
||
Are we sure this is GC related? It was extraordinarily janky for me in May, but I just loaded it up now and it was quite smooth. A sorted graph of the GC max pauses in that session (about 5 minutes of play) looks like:
▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▄▄▅▅▅▅▇█
The vast majority of GC's hit their 10ms limit, a couple blew it out by a bit and several hit 20ms. The two 30ms GC's I witnessed were at startup and shutdown, where we don't GC incrementally.
Updated•9 years ago
|
Flags: needinfo?(sphink)
Reporter | ||
Comment 5•9 years ago
|
||
I'm not a super devtools profiler expert, but I did profile it before I filed the bug and it seemed to indicate the time was in GC. Sadly I don't know that I saved that profile anywhere. :-(
Comment 6•9 years ago
|
||
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #5)
> I'm not a super devtools profiler expert, but I did profile it before I
> filed the bug and it seemed to indicate the time was in GC. Sadly I don't
> know that I saved that profile anywhere. :-(
Well, we landed some pretty massive performance improvements to nursery marking last month, so that might be some of it. It's pretty easy for code outside the GC to create a ton of work in the GC, so maybe something changed to gecko or chrome in that time that reduced the heap's burden? Or maybe agar.io noticed and changed their code to be friendlier to our GC?
Reporter | ||
Comment 7•9 years ago
|
||
Well, whatever happened, it plays fine now. Thanks for looking.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
It seems like the only way to make the game play smooth is to change the power plan to "Performance".
When in "Balanced" mode, it stutters every couple of seconds.
There is definitely a bug passing by here.
Comment 9•9 years ago
|
||
"it plays fine now" not for me, it still stutter in 38.0.5 whereas it run smooth on internet explorer and chrome.
I dont know what is the "DevTools profiler", how can we help trace performance issues or help in any way?
Comment 10•9 years ago
|
||
(In reply to Guillaume .J from comment #9)
> "it plays fine now" not for me, it still stutter in 38.0.5 whereas it run
> smooth on internet explorer and chrome.
>
> I dont know what is the "DevTools profiler", how can we help trace
> performance issues or help in any way?
Here is an overview:
1. Download https://www.mozilla.org/en-US/firefox/developer/ (or Nightly, if you prefer)
2. Load your test case
3. Tools > Web Developer > Performance
4. Start recording
5. Trigger the stuttering
6. Stop recording and analyze using the waterfall to verify whether the stutter is caused by GC or something else. https://developer.mozilla.org/en-US/docs/Tools/Performance/Waterfall
Comment 11•9 years ago
|
||
38.0.5 is a few versions behind the current development branch (Nightly), so maybe the necessary fixes haven't made it there yet. If Nightly is smoother that's a good indication that it wasn't changes on agar.io's end at least!
Comment 12•9 years ago
|
||
Now i see, thanks for the infos. I'll give it a try on the nightly branch tonight.
Comment 13•9 years ago
|
||
So, my 2 cents. I tried with the 41.0a1 release and for me the result is worse than with 38.0.5 version.
Here is a screenshot of the profiler result. Hope it'll help?
Comment 14•9 years ago
|
||
(In reply to Guillaume .J from comment #13)
> Created attachment 8615552 [details]
> result of performance profiler
>
> So, my 2 cents. I tried with the 41.0a1 release and for me the result is
> worse than with 38.0.5 version.
>
> Here is a screenshot of the profiler result. Hope it'll help?
That shows that GC is /not/ the cause of the jank you are seeing: there are no GC markers there. It looks like it is all time spent in JS. I suggest checking out the call tree view to see what JS functions are dominating the profile.
Comment 15•9 years ago
|
||
(Although I know the [////////] grouping of markers that are close together is misleading. We are working on it in bug 1169439 and bug 1169887)
Comment 16•9 years ago
|
||
maybe this will help more?
Comment 17•9 years ago
|
||
In Nightly or safe mode I cant play it well,too.
now IE is best to play it.
You need to log in
before you can comment on or make changes to this bug.
Description
•