|
|
|
|
|
by iamstef
3541 days ago
|
|
You may want to give the follow script a try: * https://gist.github.com/krisselden/d3ce3cbb37cc6035b0927fdbf... It flips some handy flags providing useful output, this output can quickly illuminate issues the regular tools do not (yet). Running this on the example you linked to bellow, shows that a series of functions are deopting and optimizing repeatedly. most likely causing at-least some of the sawtooth pattern you see. example output (likely related to the problem): ```
removing optimized code for: r.getViewMatrix]
[removing optimized code for: r._isSynchronizedViewMatrix]
[removing optimized code for: r._computeViewMatrix]
[removing optimized code for: r._isSynchronized]
[removing optimized code for: r._computeViewMatrix]
[removing optimized code for: r._isSynchronizedViewMatrix]
[removing optimized code for: r._isSynchronized]
[removing optimized code for: r._computeViewMatrix]
[removing optimized code for: r._isSynchronizedViewMatrix]
[removing optimized code for: r._isSynchronized]
[removing optimized code for: r.getViewMatrix]
[removing optimized code for: r._isSynchronizedViewMatrix]
[removing optimized code for: r._computeViewMatrix]
[removing optimized code for: r._isSynchronized]
[removing optimized code for: r._computeViewMatrix]
[removing optimized code for: r._isSynchronizedViewMatrix]
[removing optimized code for: r._isSynchronized]
[removing optimized code for: r._computeViewMatrix]
[removing optimized code for: r._isSynchronizedViewMatrix]
[removing optimized code for: r._isSynchronized]
[removing optimized code for: r.getViewMatrix]
```
---note: Credit for this should go to @krisselden the author of the above gist not me. |
|
For this reason I always let the game run for 10-15 seconds before I profile, figuring that by that time most of the opt/deopt churn will be finished. And this (very useful) script seems to back this up - I get output like yours at startup, but if I wait a while and then rm the output files, further output is relatively minimal.
So I'm inclined to think that opt/deopt stuff isn't the issue, and there really are lots of JS heap objects getting allocated somewhere. At the same time though, when I used Chrome's built-in memory profiling I see a bunch of deopt-related strings, so maybe I'm way off base. If anyone sees what I'm missing please do clue me in.
(Also: great tip on the script!)