# Performance. Is there any way to make work faster?

**URL:** https://discourse.processing.org/t/performance-is-there-any-way-to-make-work-faster/20183
**Category:** Coding Questions
**Created:** [April 26, 2020, 5:15pm UTC](https://discourse.processing.org/t/performance-is-there-any-way-to-make-work-faster/20183 "2020-04-26T17:15:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kmorozov](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@kmorozov](https://discourse.processing.org/u/kmorozov)
#### Post date: [April 26, 2020, 5:15pm UTC](https://discourse.processing.org/t/performance-is-there-any-way-to-make-work-faster/20183/1 "2020-04-26T17:15:48Z")

</div>

Hi all.

I’m trying to study p5js and desided to rewrite some sketch from processing to p5js. Here it is - [https://www.openprocessing.org/sketch/882019](https://www.openprocessing.org/sketch/882019).

Original tutorial in processing is here - [https://timrodenbroeker.de/processing-tutorial-kinetic-typography-1/](https://timrodenbroeker.de/processing-tutorial-kinetic-typography-1/)

So, it works. But i am unpleasantly surprised by performance. May be I did something wrong or is there any way to make it faster?

---

<div class="post-metadata">

### Author: ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)
#### Post date: [April 26, 2020, 8:22pm UTC](https://discourse.processing.org/t/performance-is-there-any-way-to-make-work-faster/20183/2 "2020-04-26T20:22:01Z")

</div>

Have you tried measuring which part of the code is taking the most time?

---

<div class="post-metadata">

### Author: ![kmorozov](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@kmorozov](https://discourse.processing.org/u/kmorozov)
#### Post date: [April 28, 2020, 12:02pm UTC](https://discourse.processing.org/t/performance-is-there-any-way-to-make-work-faster/20183/3 "2020-04-28T12:02:24Z")

</div>

When I exclude cycle part, everything works fine.

---

<div class="post-metadata">

### Author: ![kmorozov](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@kmorozov](https://discourse.processing.org/u/kmorozov)
#### Post date: [May 8, 2020, 6:02am UTC](https://discourse.processing.org/t/performance-is-there-any-way-to-make-work-faster/20183/4 "2020-05-08T06:02:24Z")

</div>

Now, I added fps counter and see, that copy() function slows down performance. I have a cycle with copy(), which copy 1 pixel and increasing cycles i have downgrade fps. 1 cycle - 60fps, 2 - 40, 4 - 20, 8 - 10. And it doesn’t depends of size of copy, only the fact itself.
