Parallel Lua Beta

Did the ability to change properties while parallel ever get added? I would really love that. when dealing with a script that needs to change properties quite often, I swear I’m slowing down my code by having to un-parallel so often. Perhaps I’m putting them in the wrong places, but I genuinely have been losing performance on so much of my code when trying to make it work in parallel.

This is actively in development. For now ideally you would batch up all the changes you wanted to make, and then desynchronize once and make them all. Switching back and forth can incur a one frame (23ms) penalty, so it will slow you down if you do it a bunch.

4 Likes

That makes sense. I was actually trying to use it for something rendering every frame, which explains why it slowed me down - Syncing every frame basically nuked the performance. Oh well, I can wait.

Well, you may not care, but I’m sure other developers do.

Here would be a solution to the HLSL and GLSL coding problem: Make a section specifically for shaders in the toolbox, where people can take shaders that are coded by other people and use them in their game.

1 Like

Shaders are interesting to think about, but if they ever get implemented in Roblox it would be an entirely different project.

7 Likes

So is this a yes to shader code in the future? :eyes:

2 Likes

What about creating multiple script objects? If I have multiple scripts in my game, say, 3 different server scripts, is that considered multi-threading?

A script is the same as a coroutine. Only one coroutine can run at a time. If you want a better explanation, coroutines are an implementation of green threads.

So Roblox runs different scripts in a queue?

Roblox runs coroutines in a queue. A script just creates a new coroutine when ran.

1 Like

Thanks. That’s the kind of answer I wanted to hear.

I wish you guys changed how tables worked too right now they cause a lot of performance penalty if you heavily rely on them.

Example:
Something like checking a grid of blocks and finding which ones are touching into each other every time a block is deleted so you could put them into groups etc. literally freezes the entire server unless you implement something like MaybeYield in fact through some experimenting I found out ray casting for something like that is about 3 times faster when done correctly. :thinking:

@EthicalRobot

Do you think you could give your best estimate as to when this feature will be out of beta?

A couple of months? a year?

1 Like

I’m very interested in the implementation of the global container. How would access across multiple VMs work, and would things like metatables and table addresses stay the same?

Also, it would be amazing if we could manually create and manage threads from a single script. My games use a single-script architecture, meaning all of the logic is separated into modules called from a single script and local script. I know many others work the same way, however this wouldn’t work too well with the new actor system.

This is a very amazing feature… But** Its quite performance taking and maybe it could be used for bitcoin mining? (Already tested it and it seemed to work… (10x faster…) .-. )

[Note: I won’t be publishing or sharing the bitcoin miner for parallel lua, as i am unsure if this would be against the TOS (I believe it would…)]

I don’t think there is anything that can be done to fix any of these two… Anyhow it is very useful when trying to run many loops, fast and maybe even synced? :slight_smile:

1 Like

One of the internal tests is a “fake” bitcoin miner that just tries to find the smallest sha1 hash it can.

Please don’t actually try to mine bitcoin :slight_smile: .

14 Likes

This is a god-send from the engineers at Roblox.
Thank you so much for this amazing feature!

Really looking forward to being able to create Instances and manipulate properties, as these can be a grueling task to do in bulk.

2 Likes

Implementing my own terrain generator using fBM. It’s amazing how easy it is to just chunk things up & throw it into an actor. It just works™. I like it.

Is there any change to when this will be fully released?

1 Like

Is there some type of demo place for this?
I cant really figure out exactly where/how i could be using this.

It would be very helpful if there was a demo place where some simple code is spread across 16 threads or a getchildren loop spreaded across 16 threads.