Publisher | Casey Walsh-Warder |
---|---|
File size | 124.14kB |
Number of files | 20 |
Latest version | 1 |
Latest release date | 2022-11-11 04:08:15 |
First release date | 2022-11-11 04:08:15 |
Supported Unity versions | 2018.4.2 or higher |
If your game needs better performance, sometimes parallelism is the answer.
This is a parallel for loop. With a normal for loop, you usually do something with 0, then 1, then 2, and so on, such as changing the value at each index of an array. With a parallel for loop, you can use multiple CPUs to process several at a time. That can make your code run several times faster.
You can already use a parallel for loop in C#. C#'s Parallel.For isn't designed for games though. It has a lot of features, but too much overhead for calling multiple times each frame. It also produces garbage, causing lag spikes.
Faster Parallel.For is (hopefully) faster and doesn't produce garbage.