Performance probelms - drawing to much stuff?

Hi!
I have some bad fps problems with my current project. It is supposed to run on mobile devices, but only has about 5 fps when ran. I draw a lot of stuff on the screen, but there’s no way around that as it consists of 2 tables which change sizes with every start. This is my code(simplified):

image(header[0], 0, 0 - y, 1080, 100);
image(header[1], 0, 45 * allData.length + 150, 1080, 100);
  for (int i = 0; i < allData.length; i++) {
    image(row[0], 0, 100 + i * 45, 1080, 50);
    image(row[1], 0, 250 + i * 45 + 45 * allData.length, 1080, 50);
  }
  for (int i = 0; i < seperateData.length; i++) {
    for (int j = 0; j < 4; j++) {
      text(seperateData[i][j], x[j], i * 45 + 143);
      text(seperateData[i][j + 4], x[j + 4], i * 45 + 45 * allData.length + 293);
    }
  }

The row images are only 1kb big, and the header images are around 10 and 17kb.

Okay so I just found out that most lag actually comes from drawing the text on the screen.

1 Like

Solved it. Just set the renderer to P2D with size(something, something, P2D);.

1 Like