ipygany icon indicating copy to clipboard operation
ipygany copied to clipboard

CPU usage and scene idle

Open benbovy opened this issue 4 years ago • 3 comments

I noticed that CPU usage increases significantly (+ 20%) when the scene is shown on the screen (active tab), even when I'm not interacting with it at all (nor playing any animation). When multiple scenes (or scene views) are created in a notebook, fans are running high.

Tested on both Firefox and Chrome, on a MacBook Pro 13-inch, 2019 (MacOS Mojave). I'm using a 4k screen.

Out of curiosity, I've checked some examples from https://threejs.org/examples. Some of them seem to use a lot of CPU (especially animations), while others (static) don't use much CPU when not interacting with it.

benbovy avatar Feb 01 '21 09:02 benbovy

I wonder what happens if you take a ThreeJS example containing a more refined mesh. If the CPU usage is high, I suspect it's because you don't have a dedicated GPU but are using an integrated one.

martinRenou avatar Feb 01 '21 12:02 martinRenou

If the CPU usage is high, I suspect it's because you don't have a dedicated GPU but are using an integrated one.

Yes that's an integrated one. I'm not very surprised that CPU usage would quickly increase in that case, but I was wondering what could use CPU (or GPU) resources when the ipygany scene is in an apparent "idle" stage.

benbovy avatar Feb 01 '21 13:02 benbovy

I wonder what happens if you take a ThreeJS example containing a more refined mesh.

For my use case (3D terrain visualization) I could also try the other way around, e.g., using something like pydelatin on the server side. It would also optimize data transfer. It might be tricky to compute an optimal, fixed mesh on time-dependent evolving terrain data, though.

benbovy avatar Feb 01 '21 13:02 benbovy