ComputeLua - A simple library to make Parallel Luau easier using Unity like ComputeBuffers

Latest Stable Release: 1.2.0 (4/29/2024)
ComputeLua Module
Github
Documention
API

External resources used

Promise


Why ComputeLua?

Simply using ComputeLua you can easily send a bunch of workers to run a function all in parallel, then get them to work on some data and send them back to the main thread.

ComputeLua is great for large computations that need to happen quickly, such as:

  • Terrain generation
  • Editing the vertices of an EditableMesh
  • Simulation like waves

ComputeLua is fully and statically typed, so autocompletion will happen and errors will throw is incorrect types are inputted.


Limits

The data that can be sent over to workers can only be these data types. This is due to the limitations on SharedTables, but these data types should be all you need.
(Only data types for ComputeBuffers and the VariableBuffer)

  • Vector2
  • Vector3
  • CFrame
  • Color3
  • UDim
  • UDim2
  • number
  • boolean
  • string

No, you cannot have functions in these buffers.

To make everything run faster, the keys for ComputeBuffers and the VariableBuffer must be a number. A worker can easily access the current data they are working on within the massive table by using their dispatch ID if the keys are all numbers


How do I use this?

A detailed description can be found on the documention site
Getting Started

Anymore information you may need can be found on the API site
API


How would you rate ComputeLua?

  • Amazing
  • Great
  • Good
  • Bad
  • Very Bad

0 voters

13 Likes

ComputeLua - Stable Release 1.1.0 (4/24/2024)

  • Created a Github with documentation and an API page
  • Added ComputeLua.CreateThead(actor: Actor, threadName: name, callback: (number, VariableBufferDataType) -> ())
  • Changed Dispatcher:Dispatch() to return a Promise.defer()
  • Variable Buffer is now a SharedTable
2 Likes

ComputeLua - Patch 1.1.1 (4/26/2024)

  • Performance increase
1 Like

ComputeLua - Stable Release 1.2.0 (4/29/2024)

  • Added the ability to edit the batch size
  • Fixed batch size not working correctly
  • Fixed batches breaking if it was less than the amount of threads
  • Fixed typo in documentation