Parallelizer is a lightweight and performant module to parallelize heavy and intensive tasks that would otherwise put a lot of strain on performance. Parallelizer aims to make parallel luau more accessible and performant without sacrificing ease of use and readability.
What is parallel luau you may ask? Parallel luau is a way to spread the computation load into multiple cores with the help of Actors. This helps in reducing strain and lag from the heavy computations that you may use.
Parallelizer uses a buffer-based approach to serialize packets of data from parallel to serial, which minimizes the memory cost of parallelism. Parallelizer doesn't have additional dependencies as its designed to be simple and efficient.
Credits & Footnotes
Could anyone suggest a stress test method I could use? I’m trying to test the capabilities of this module before I’m going to redo my shader.
If you have any suggestions in mind, feel free to share them here! Or if you’ve encountered issues with the module, don’t hesitate to ask for help! I will assist you through the process as soon as possible.
Thanks to ComputeLua for inspiring in making this module.
Made it so you can pass in arguments directly into both the dispatch functions since I realized it would get tedious to set the Instruction table repeatedly
Renamed .CreateNewJobScheduler to .CreateJobScheduler
Replaced the for range loop in :Dispatch to a for in loop (I believe it’s faster since it doesn’t have to index every iteration)
I have tried to optimize some parts of the module, but most of them just leads to worse performance or very little to no difference. One of the optimization I tried was using table.move instead of a for loop, it just turns out to be slower by 5ms so I kept the for loop
Planning to use this in the near future as it seems very useful. There aren’t many resources out there on understanding or implementing Parallel Luau, not for many use cases at least.