Problem using multiple cores of a processor

ROBLOX seems to have a problem using multiple cores of a processor, and as shown by HWMonitor, and will use all threads when it is not selected, but as soon as you select the process it will start using only two cores, leading a lot of stuttering.

2 Likes

Those two videos look fine to me.

I don’t think all cores using 20% is because of Roblox. He should use something like Process Explorer to see how much of each core just robloxplayerbeta.exe is using. I notice nothing strange, though.

1 Like

Not a bug. Roblox wasn’t entirely designed for maximum available core utilization. We do some threading (e.g. rendering), but the worst offender - the scripts can’t be parallelized due to everything being accessible from anywhere.

4 Likes

Note: please ask non-personal questions in discussion threads, as they may be useful for other developers as well.

Concurrent execution of many Lua scripts on the same VM (besides VM performance overhead) is prone to a lot of concurrency-related errors, mostly due to the fact that e.g. two scripts trying to access the same object is a typical race condition. And having all objects accessible without restrictions from any script and context (including e.g. engine callbacks, async resumes, etc.) pretty much precludes any meaningful workarounds.

We did discuss a few alternatives like having “compute-only” contexts where scripts would run in parallel but wouldn’t be able to directly access the Datamodel or each others contexts, instead relying on specific communication channels. So far, we couldn’t come up with any meaningful interop model that didn’t involve serialization.

9 Likes

Here’s a response from the original poster:

"Well, if you can not see what is happening, I will explain it to you. As you can see, when I start the recording, I am outside the ROBLOX window, and all of my threads are hovering around 20%. When I select the ROBLOX process and start moving my camera around, all of my processor threads go down beside the first two, which spike up more than the rest and max out. This is a sign of bad optimization or an error on ROBLOX’s part, as when the ROBLOX process is selected, it is clearly not utilizing all of the resources that it has available to it, which results in a lot of stutter and lag for me that I can not do.

There is no reason that ROBLOX should not be using multiple cores, and it has not done this before. I have checked my settings in ROBLOX Studio, and there is nothing there that explains it. The video made have not shown as much stutter, but I have found better examples of it like Work at a Pizza Place, where the game became almost unplayable at times due to the input lag I was receiving. My processor is an Intel i7-4790k overclocked to 4.6GHz, so I see no reason on my part as to why ROBLOX should be lagging.

EDIT: Well shit. An admin says that it hasn’t happened. Throw in something as well asking him why it is doing it now, and it has not done it before, and why the ROBLOX process doesn’t seem to do it when I am tabbed out, but it does it when I am tabbed in.

EDIT2: Add in this:
I have found a temporary solution to the problem. I was messing around with the rendering settings in ROBLOX, and I set the graphics mode to Vulkan, where ROBLOX seemed like it was using three threads instead of just two, which provided a temporary solution to the problem.

Please put this in the comments of that post.

Thanks,
EncryptedStrike"

1 Like

Roblox*

3 Likes

Indeed. Did he happen to have any questions?

Out of interest - can you send me a link to the first game?
It appears to be a stolen version of @Vaktus 's Recruitment Centre, and obviously that should be dealt with.

Nope, but he thanks you for your response