phetsims / energy-skate-park-basics

"Energy Skate Park: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/energy-skate-park-basics
GNU General Public License v3.0
2 stars 9 forks source link

High GPU/Memory Usage #426

Closed EthanWJohnson closed 6 years ago

EthanWJohnson commented 6 years ago

-Windows 10 Ver. 1709.16299.547

-Chrome Ver. 67.0.3396.99

Energy Skate Park Basics is taking up an alarming large amount of GPU power. On any screen other than the home screen, sitting idle with no movement onscreen (and not paused) it's sitting anywhere from 45-50% GPU usage. Anything happens onscreen, GPU usage spikes to 80% depending on what's happening--highest spikes are on the playground screen.

image The bottom process in this image is the ESPB tab/process.

In a similar vein, the sim's memory usage seems inconsistent. Chrome dev tools are reporting only 40MB of heap memory, but the sim seems to be taking at least 300 when loaded and idle based on Window's monitoring tools. And on the playground screen, while manipulating track nodes on screen it is possible to spike chrome's memory footprint by 400 megabytes.

I'm not sure where the GPU and memory footprint is coming from, and i'm not sure why chrome isn't reporting the sim's true memory usage, but it is not going to play nicely with older and less powerful devices; iPad 2's performance, for example, is reportedly abysmal. Few, if any, other simulations are coming close to ESPB's GPU usage even under heavy usage. Very likely related to https://github.com/phetsims/energy-skate-park-basics/issues/423.

Done for https://github.com/phetsims/QA/issues/134

Debug information;

Name: ‪Energy Skate Park: Basics‬ URL: https://phet-dev.colorado.edu/html/energy-skate-park-basics/1.4.0-dev.1/phet/energy-skate-park-basics_en_phet.html Version: 1.4.0-dev.1 2018-06-20 00:09:06 UTC Features missing: touch User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 Language: en-US Window: 1366x645 Pixel Ratio: 1/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 4096 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"928741cf","branch":"master"},"axon":{"sha":"f0522e7c","branch":"master"},"brand":{"sha":"89d28f63","branch":"master"},"chipper":{"sha":"e8946524","branch":"master"},"dot":{"sha":"6482f8c9","branch":"master"},"energy-skate-park-basics":{"sha":"288fcefd","branch":"master"},"joist":{"sha":"22e437d5","branch":"master"},"kite":{"sha":"a1086efc","branch":"master"},"phet-core":{"sha":"17326041","branch":"master"},"phet-io":{"sha":"3ea0727a","branch":"master"},"phet-io-wrapper-classroom-activity":{"sha":"53708616","branch":"master"},"phet-io-wrapper-hookes-law-energy":{"sha":"8a546a32","branch":"master"},"phet-io-wrapper-lab-book":{"sha":"1527afd6","branch":"master"},"phet-io-wrappers":{"sha":"8d814eab","branch":"master"},"phetcommon":{"sha":"6ec8cd89","branch":"master"},"query-string-machine":{"sha":"4182612f","branch":"master"},"scenery":{"sha":"88cb642e","branch":"master"},"scenery-phet":{"sha":"7bcde0b2","branch":"master"},"sherpa":{"sha":"88c3b828","branch":"master"},"sun":{"sha":"7579e8fa","branch":"master"},"tandem":{"sha":"8461b6f3","branch":"master"}}

jessegreenberg commented 6 years ago

I see GPU usage while running the sim, though not as high for my machine as reported in the ticket. For me, here is idle: capture

And when skater is moving with bar and pie charts: moving

I am not concerned by the high memory usage of the sim as reported by Windows because that is a different measurement than the heap. Windows is reporting the RAM usage, including the GPU process, while Chrome heap size is just reporting the size of allocated JavaScript and DOM objects.

Thanks for writing this up @EthanWJohnson, this is good to be aware and keep track of. But I don't think this requires any specific work. @ariel-phet can you please review this issue and close if you agree?

ariel-phet commented 6 years ago

@jessegreenberg @EthanWJohnson I agree this is good to be aware of, but we have not had any reported performance issues from the world or in our testing so I don't think this requires any specific work. Marking "won't fix" and closing