# Performance probelms - drawing to much stuff?

**URL:** <https://discourse.processing.org/t/performance-probelms-drawing-to-much-stuff/9301>\
**Category:** Processing for Android\
**Created:** [March 14, 2019, 5:42pm UTC](https://discourse.processing.org/t/performance-probelms-drawing-to-much-stuff/9301 "2019-03-14T17:42:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Schred](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/schred/32/13146_2.png) [@Schred](https://discourse.processing.org/u/Schred)\
**Post date:** [March 14, 2019, 5:42pm UTC](https://discourse.processing.org/t/performance-probelms-drawing-to-much-stuff/9301/1 "2019-03-14T17:42:46Z")

</div>

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):

```auto
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.

---

<div class="post-metadata">

**Author:** ![Schred](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/schred/32/13146_2.png) [@Schred](https://discourse.processing.org/u/Schred)\
**Post date:** [March 15, 2019, 3:19pm UTC](https://discourse.processing.org/t/performance-probelms-drawing-to-much-stuff/9301/2 "2019-03-15T15:19:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Schred](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/schred/32/13146_2.png) [@Schred](https://discourse.processing.org/u/Schred)\
**Post date:** [March 15, 2019, 3:45pm UTC](https://discourse.processing.org/t/performance-probelms-drawing-to-much-stuff/9301/3 "2019-03-15T15:45:33Z")

</div>

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