Strange performance + Chrome Dev Tools

I built a P5Js app that runs full screen on an android tablet. When running it gets around 20fps maximum, sadly.

Once I connect the tablet to chrome dev tools though (over usb), I am able to get the frame rate up to 60fps for no apparent reason. If I use the "remote devices" tool and press the "refresh" button on the chrome developer tools, It greatly speeds up the performance of the chrome tablet and P5 application. If I refresh using the native android browser button, the speeds revert back to 12-15fps.

Does anyone know why this is? A friend suggested that the android tablet needs it's gpu to be accelerated in order to attain those speeds and that the chrome development tools forced the GPU to activate.

I turned on the FPS meter and GPU rendering visualizer that appears on the tablets screen corner. It shows "GPU Raster - Off (Viewport)" When the tablet has refreshed using it's browser button I can also see how much GPU memory is being used. (48mb/256mb MAX) When the Chrome Remote Dev Tools refreshes the page I do not see the GPU memory viewer.

Is it possible that Chrome Dev Tools is offloading the GPU rendering or memory onto my laptop instead and speeding up the tablet? This would be strange because the speed improvements gained after refreshing chrome dev tools persist even after unplugging the tablet from the dev computer.

Does anyone know how to attain the 60FPS speeds that I am able to get while connected to dev tools? This is a strange bug and I am not sure where to look for a solution.

Thanks!

Answers

  • edited December 2016

    Digging deeper I took a sample of how P5JS worked when it was going 60 and what it was doing when it was going 12. The results seem to show a difference in displaying images. I always pre-load all images into an array before starting the sketch. The only thing that is different is how I refresh the android.

    If the images are stored within PImage objects is that not GPU ram? Should the drawing always be directly from gpu or does it reload them from elsewhere?

    This shows the slow performance at 12-15 fps:

    Screen Shot 2016-12-21 at 5.19.24 PM

    Screen Shot 2016-12-21 at 5.19.24 PM copy

    This shows what it does when it is running at 60 fps:

    Screen Shot 2016-12-21 at 5.19.34 PM

    Screen Shot 2016-12-21 at 5.19.34 PM copy

  • Was this question ever resolved for you? You have done enough detective work that -- if nobody on the forum can help you -- it might be worth posting this question to p5 Issues to see if the core devs can point you in the right direction.

    https://github.com/processing/p5.js/issues

Sign In or Register to comment.