Ok, so when it comes to threading, here’s the deal.
Your actual CPU can only handle as many threads as it physically is capable of doing. Usually one per core, unless you have a CPU that allows hyper-threading (or similar technology). Although, technically hyper-threading isn’t a true separate thread, because it really is only parallel processing if the two parallel cpu operations at that very moment are complimentary to hyper threading. Otherwise one ends up having to wait for the other. You can kind of think of it as an extra ‘half’ thread.
Yet, you can actually spin up as many ‘threads’ in code that you want. This is because those threads aren’t actual threads on the CPU. You can have threads on a single core CPU. Every program running in Windows is technically its own thread (or group of threads).
This is called multi-tasking. The operating system allows each application to run code at the same time by allowing each thread intermittent access to the CPU. Making it appear like they’re running in parallel.
This is what happens when you spawn more threads than you have physical cores in your computer.
The average computer has 2 to 4 cores now a days (hyper-threading possibly, or even 8 cores for some high end machines, and more for servers… server type situations though are usually dedicating those cores to other things though). Spawning those threads to give you a perceived ‘speed’ boost won’t really actually give you a perceived speed boost once you surpass the actual number of threads the CPU can support. And don’t forget that those cores are also being used by other applications running, so you probably won’t be accessing all of them anyways.
Having thread counts beyond that core count (and why you normally don’t count the cores) is useful for reasons other than speed. Multithreading/Async processes has other uses. For example while downloading a file, you don’t want the system to hang, you want to also animate the screen. This has nothing to do with speed, and all to do with asynchronous behaviour.
So yeah, if your meshes are 50 or 60 megs. And you’re consuming a gig of memory. That’s what… 18 meshes? More if many are small? And you’re giving all those individual meshes their own thread?
Well, beyond 4 threads, you’re probably not seeing much gains. For the average casual gamer or cellphone, you’re probably not seeing much gains pass 2 threads!
I’d honestly go with 2 threads.
Note - you may see minor gains for the first couple of threads over the cpu core count. This can sometimes be the result of the operating system load balancing threads. A generic thread created in code isn’t necessarily assigned a specific core. But instead the OS might shift it between cores to balance out load. CPUs now a days with their variable speeds and the sort optimize in various ways that give over all system gains.
With that said though, expecting such gains is not guaranteed. And you shouldn’t write something in hopes of reaping those extra milliseconds of efficiency at the cost of a gig in memory!
Technically that memory cost could cause system slow-down.
And also you could technically get speed increases by recycling the arrays you use, rather than allocating for each array.