What parts of a computer affect what performance variables?

Hi,

I’ve been curious about this for a while and I’m currently looking to get a few Raspberry Pis with defold apps running on them for a new project. There’s a significant price difference on different models and I’d like to make sure I get the right ones for the right price.

So, my question is: how do the various characteristics of a computer affect performance? For example: Do large atlases require lots of RAM? Does 60FPS require a faster processor? Does having a lot of code in the update function mean you need more cores?

My app has:

  • atlases that can be around 2048*2048
  • manually setting the position of 1200 GOs with sprites (in the update function) with a little mathematics
  • I need to load and unload atlases/collections quite quickly
  • some fake 3D which means the near and far of the camera are set to something like -500, 500
  • two GUI layers, one in front and one behind the GOs
  • I can’t imagine what else I am doing that would count as “heavy lifting”.

It would be great to know how much RAM I need and what processor speed is right for me. Basically, I’d like to know if 2gb or 4gb (or maybe even 1gb of ram) would be enough. And if processor speed is better at 1.5 or 1.8. But I’m also interested in general in learning a little more about this, and getting the POV of defold users.

It depends. You need to consider both “CPU RAM” and “GPU RAM”. Some texture formats are compressed and can be uploaded to GPU RAM compressed. We use Basis Universal as a generic compressed format which at runtime gets transformed into a compressed format suitable for the specific GPU. I’m not entirely sure of the process when loading a texture from the archive, into memory and upload to the GPU. How much memory is needed? @jhonny.goransson or @JCash will be able to answer this.

An uncompressed textures is likely to use 32 bits per pixel where Red, Green, Blue, Alpha each uses 8 bits (1 byte). This means that a 2048x2048 texture takes 2048x2048x4 bytes or about 16 Mb. If you also generate mipmaps (can be disabled) then add roughly 30% more.

It depends on what you are doing. If you run a lot of code then you will use a lot of CPU cycles. If you run too much code on a slow CPU then you might not have enough time to finish running the code within the 16.6ms you have in a single frame.

If you are rendering a lot of things or have complicated shader code and a slow GPU then you might not finish rendering everything within a single frame.

Lua is single threaded which means that Defold mainly uses a single thread and thus also a single core. HTTP requests, sound playback and some other things uses threads and can leverage multiple cores, but the overall game loop is single threaded. Also, on HTML5 everything is single threaded.

Compressed or uncompressed? If uncompressed then it sounds like a 16k texture? You will need to think about GPU memory if you handle a lot of large textures like this.

This will require CPU power. But Lua is fast so it really shouldn’t be a huge problem. It depends on the calculations though.

You need to consider both CPU speed and memory/disk speed.

GPU speed, but really shouldn’t matter much.

Will generate more drawcalls. GPU speed.

You need to measure memory usage yourself. Check with the profiler and other memory profiling tools. Perhaps enough to use some simple activity monitor or similar to check overall memory usage of your application to get an understanding of memory use.

Those 300Mhz should not really matter much unless you’re really maxing out CPU usage. Check with a profiler tool or similar!

4 Likes

Fantastic answer! Thanks.