Android mode 40% frame drop, without code

void setup()
{

}

void draw()
{
  println(frameRate);
}

That is the only code. Even with a diy framerate check instead of println(frameRate); same results.
Tested on Galaxy S9: sometimes stable 60fps, 70% of the time drops to 35fps almost immidiately or after 5-30 seconds.
Tested on Galaxy Tab-A: spikes down to 40fps every few seconds, hovers around 55.

I was having some really bad fps problems when switching to android mode. I fixed and optimized, but I eventually commented out all of my code until only that was left chasing the problem. My next step is to develop with Android Studio, using Processing as a dependancy (which is new to me, I have never done much outside of Processing, but I guess it’ll be good if I want to become an app developer, I just hope the problem does not happen there as well).

Processing 3.5.3
OS: Linux Mint 19.2 Cinnamon
Kernel: 44.15.0-54-generic
Processor: AMD A12-9720P RADEON R7

Android SDK Build-Tools: 26.0.2
Android SDK Platform 26: 2
Android SDK Build-Tools: 26.0.3
Android SDK Tools: 26.1.1
Android SDK Platform-Tools: 29.0.2

Galaxy S9 Android Version: 9
Galaxy S9 Kernel: 4.9.112-16319031
Galaxy S9 Model: SM-G960W

The full code is running at about 20fps on the S9, 16 on the Tab-A. In any case it would seem I can not get my code to not lag somehow somewhere, even though I am practically certain all magor sources are gone. I do not use any images (image(PImage, x, y)) as that seems to really mess things up. I have PShape objects for my tiles instead of images or recalculating the shape data for each redraw. I don’t have things that update when they don’t need too, and what I do is so minor it takes time<=1ms. Link to full code here:


or here: https://www.dropbox.com/s/4k8obaxbxvyx0sx/WordWiseBugFullCode.zip?dl=0

Any insights? Thank you

1 Like

Hi.
I am trying to load your code, but what is “home/madscience2728/sketchbook/Screen_Manager_Library/Screen_Manager_Library.pde” supposed to do in this tab?

My first suggestion is to use the P2D renderer if you are not doing so. Add fullScreen(P2D); and see if you see an improvement.

I would also avoid calling println in every draw loop. For example I would do: if(frameCount%60==0) {println(frameRate);}

Kf

2 Likes

Shoot, sorry I forgot the library is actually a symlink, as it makes it acting like a libray a million times easier because I can edit anywhere with instant universal changes.

Update: The problem is due to WQHD+ resolution on Android. I’ll try adding the P2D in my test program, see if that works. For now I’ve moved on to Unity and making my game awesomely 3D. Thank you.

2 Likes