# Hardware solutions for long renders

**URL:** https://discourse.processing.org/t/hardware-solutions-for-long-renders/32370
**Category:** p5.js
**Created:** [September 22, 2021, 9:52am UTC](https://discourse.processing.org/t/hardware-solutions-for-long-renders/32370 "2021-09-22T09:52:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![goldorak](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@goldorak](https://discourse.processing.org/u/goldorak)
#### Post date: [September 22, 2021, 9:52am UTC](https://discourse.processing.org/t/hardware-solutions-for-long-renders/32370/1 "2021-09-22T09:52:52Z")

</div>

Hi,  
I’m struggling with some artworks I create which require a very long rendering time.  
Beyond refactoring and code optimization I’d like to know what would be the best hardware I could use to speed things up?  
Thanks

---

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [September 22, 2021, 5:53pm UTC](https://discourse.processing.org/t/hardware-solutions-for-long-renders/32370/2 "2021-09-22T17:53:58Z")

</div>

Hi @goldorak,

Which renderer are you using?

You can see this previous thread about GPU and hardware accelerated rendering:

> [@Making use of the GPU to render huge amount of objects](https://discourse.processing.org/t/making-use-of-the-gpu-to-render-huge-amount-of-objects/26267):
>
> Hi, I’m new to p5.js and WebGL, so I’m not sure if I’m using the right terminology. Let’s start with the problem: We’re currently displaying a map of objects (simple rectangles with text in them, plus some single lines). Unfortunately, the number elements can go up to 25,000, probably even more, which completely crushes the performance. At the moment, we do all the draw calls in the draw() function, which I assume, is the main problem. In an older version, there’s a manual check, if an objec…

---

<div class="post-metadata">

### Author: ![KumuPaul](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kumupaul/32/13072_2.png) [@KumuPaul](https://discourse.processing.org/u/KumuPaul)
#### Post date: [September 22, 2021, 8:19pm UTC](https://discourse.processing.org/t/hardware-solutions-for-long-renders/32370/3 "2021-09-22T20:19:52Z")

</div>

The impact of hardware on your application’s performance is going to depend heavily on your code. If you are using WebGL then you can just use the rule of thumb that a GPU that is faster and has more memory will give you better performance, and many browsers [will use the GPU for rendering canvas elements even using the 2d rendering context](https://www.middle-engine.com/blog/posts/2020/08/21/cpu-versus-gpu-with-the-canvas-web-api). However, a lot will depend on how your drawing code is structured. If you have a large number of p5.js drawing instructions per frame, there will be a lot of work done on the CPU in the javascript engine before the GPU is ever able to take over.

The only way to get good advice on this is to share an example of your application w/ code.

That said, technically, “what would be the **best** hardware I could use to speed things up” is pretty easy to answer: get a CPU with the highest available clock speed and the most L1/L2 cache; a motherboard with the fastest available Front Side Bus speed; a sizable amount of memory (\>=16GB) with the fastest available memory clock frequency and lowest latency; a GPU with the fastest clock speed, the most GPU memory, and the highest memory bandwidth. Such a setup will be astronomically expensive and only give you marginal gains over something more middle-of-the-road. The moral of the story is this is not a particularly useful question.
