I have been working on make my voxel terrain generator and I was thinking of utilising Parallel Luau to make it performant. However, it is difficult to find a suitable compromise between performance, and storage efficiency. Here are my options:
- Stick to serialised generation, using buffers to store a chunk’s data, so that chunks are more space efficient and performant to read and write to. However main thread is overworked and other threads are not utilised.
- Use parallel Luau where each worker thread has a local buffer it writes to, then use a bindable event to send that buffer from the worker thread to the main thread to keep all chunk data in one place. Downsides: Bindable event may be slow (i’m not sure tbh). Advantages: Chunks are stored in buffers, saving space.
- Use parallel Luau where each worker thread writes a string of voxel data in a shared table, so no bindable event needed and seemless data transfer. My only concern with this implementation is the storage and performance implications of using string rather than buffer, however I don’t know much about strings in luau to know its drawbacks (if anyone could shine light on this topic I would greatly appreciate it)
I would love if buffers could be values in shared tables but alas roblox did not implement that