# Strange performance issue

**URL:** <https://discourse.processing.org/t/strange-performance-issue/20976>\
**Category:** Coding Questions\
**Created:** [May 17, 2020, 4:00pm UTC](https://discourse.processing.org/t/strange-performance-issue/20976 "2020-05-17T16:00:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miguelac](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@Miguelac](https://discourse.processing.org/u/Miguelac)\
**Post date:** [May 17, 2020, 4:00pm UTC](https://discourse.processing.org/t/strange-performance-issue/20976/1 "2020-05-17T16:00:27Z")

</div>

I’m writing a game (a clone of the game “untangle”) and I’m quite happy with how it turned out.

However, while yesterday the game was running well on my phone, today after a few small additions for new features I noticed that the game was painfully slow on my phone (and spinning up my fans on the laptop).

I naturally thought that the issue was one of these new features so I duplicated the game project and started removing features. I removed so much that at this point the simplified version is very simplified and with a lot fewer features than what I had yesterday when it was running fine. Still, it runs very slowly. I even tried looking at it with Chrome’s dev tools to profile it but nothing showed up as seemingly problematic.

I was wondering if a kind soul could take a look and see if anything there is as a clear source of slowdown, like a function that changes a variable type to something that is much slower to use. The program is so simple now that I cannot understand why it is still so slow on my phone when yesterday was much nicer.

Thank you in advance.

All the best,  
Miguel

Simplified version of the game:  
[https://editor.p5js.org/Miguelac/sketches/0rR28oDfo](https://editor.p5js.org/Miguelac/sketches/0rR28oDfo)

---

<div class="post-metadata">

**Author:** ![Miguelac](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@Miguelac](https://discourse.processing.org/u/Miguelac)\
**Post date:** [May 17, 2020, 4:57pm UTC](https://discourse.processing.org/t/strange-performance-issue/20976/2 "2020-05-17T16:57:40Z")

</div>

I think this might be an issue with the “present” link. Using "sketches: or “full” like this:  
[https://editor.p5js.org/Miguelac/full/0rR28oDfo](https://editor.p5js.org/Miguelac/full/0rR28oDfo)

gives much better performance than this  
[https://editor.p5js.org/Miguelac/present/0rR28oDfo](https://editor.p5js.org/Miguelac/present/0rR28oDfo)

---

<div class="post-metadata">

**Author:** ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)\
**Post date:** [May 18, 2020, 7:21am UTC](https://discourse.processing.org/t/strange-performance-issue/20976/3 "2020-05-18T07:21:18Z")

</div>

Hello, and welcome to the forum!

> [@Miguelac](#):
>
> I even tried looking at it with Chrome’s dev tools to profile it but nothing showed up as seemingly problematic.

That’s a great idea, taking the guesswork out of the equation. Did you do the profiling on the actual phone? If not, here’s a guide to get started with remote debugging:

> **[Herramientas para desarrolladores de Chrome  |  DevTools...](https://developer.chrome.com/docs/devtools?hl=es-419)**
>
> Depura y optimiza tus aplicaciones web con las Herramientas para desarrolladores de Chrome.
