Faster Lua VM Released

Honestly, just don’t use next as an iterator and you’re good. That’s all I can think of off the top of my head.

1 Like

That was actually optimized out!

5 Likes

Now that we’re at release, is there a chance we could get a listing of the optimizations done (beyond a general “everything is faster”)?

6 Likes

Even so, I would never use the word “safe” to describe anything exposed to the client.

Great way to put it.

1 Like

I hadn’t tested it in a while, but yeah, it seems like it has been. Now my code style can go back to being normal.
image

3 Likes

Really happy to see this being rolled out. I look forward most to making detailed game map environments with more interactive elements all while maintaining smooth gameplay performance.

1 Like

Glad to see faster join times (especially when I play Phantom Forces on a mid non gaming laptop), and that exploiting might be harder (for now).

Just to get a better understanding because I only know very basic Lua scripting (I also don’t know other scripting languages). Is this just a change how the client etc communicates with the scripts or is the new Lua actually changed a bit from how you scripted before.

I’m wanting to learn more and get better at scripting so I was just curious about that.

2 Likes

The interpreter is changed. That is, the internal code that reads and runs the Lua code has been entirely rewritten to be faster.

There shouldn’t be any changes to Lua beyond how fast it is when ran.

4 Likes

Amazing, I was testing if an exploiter could lag my game using an RF in studio, but I ran about 10 while true loops (no wait) and it didn’t lag at all! I even printed out the reply since I was expecting my laptop to crash but the fps remained around 60.

1 Like

I’m not sure if it’s just me, but I found that Humanoid:MoveTo() became a little bit inconsistent (given enough use?)

Now the characters in my game can sometimes jitter and teleport around if they lag enough.

4 Likes

Wait so ROBLOX LUA runs on one core? Or am I not understanding what you mean?

1 Like

Correct, Lua execution is single threaded, there is no way to run your code using 2 cores, the only cases that i would assume are technically multi core are things like http requests.

4 Likes

Exciting new update, now I can’t wait for roblox to run on multiple cores and to actually use my 1050Ti instead of my core i5 lol

3 Likes

Were any background things changed in Studio that would cause it to crash whilst editing/closing out of scripts?

I’ve been experiencing a lot of crashing when dealing with scripts/linkedsources/packages since a day ago.

1 Like

Rendering is also done partially on a sepparate thread.

1 Like

What do you exactly mean by this? CPUs are used for logic and GPUs for rendering. Multiple threads will just spread the logic on multiple CPU threads and your 1050ti won’t be affected.

3 Likes

This is one of the bests new features of the year for the Roblox Studio! Amazing.

1 Like

The only practise (afaik) that isn’t faster is getfenv and setfenv.

Question: In the old VM, you guys got rid of tail calling. I think it was removed due to debugging complexity? Is that still the case, or do we get tail calling back in the new VM?

7 Likes

We don’t have existing plans to revive tail calls. There are more call kinds in the new VM so guaranteed tail calling is somewhat more involved compared to vanilla VM, and in regular code the performance advantages are not significant. So I would say it’s unlikely that they will come back.

4 Likes