Does RunService reduce lag?

Hi there. I’m not exactly familiar with RunService, as I only use it every once in a while. However, I’d like to know if RunService is one of the best ways to reduce lag.

  1. What do you want to achieve? Knowing if RunService reduces lag or not.

  2. What is the issue? Not knowing if RunService reduces lag. Strongly thinking not honestly.

  3. What solutions have you tried so far? I’ve tried using it a few times and looking at the RCD. AKA Roblox Creator Documentation on RunService. Not really receiving much help.

This is the current code I’ve tested for RunService. Also, if I were to use RunService, would this code be more convenient placed in a LocalScript?

local RunService = game:GetService("RunService")
local Part = script.Parent

RunService.Heartbeat:Connect(function()
       Part.CFrame = Part.CFrame * CFrame.new(0, 0, 1)
       task.wait()
end)

If there’s a more convenient way to type this code out, please let me know. Anything concerning RunService, LocalScripts, or common Scripts helps me out a bunch. Huge thanks to anyone that even considers helping me out. :slightly_smiling_face:

One Usage of RunService allows you to run frame by frame loops, It doesn’t exactly reduce lag, its more of used for Running code Frame by Frame, and the Methods it contains. I would Recommend Looking into Documentation:


There are Couple of ways to write this:

task.wait() basically is as fast as RunService.Heartbeat, So in turn, you can use, a regular while task.wait() do loop and it will work the same

while true do
    task.wait()
end

On the topic of loops, you can also use them to wait for certain periods of time, we can use RunService.Heartbeat:Wait() (this is yield code) to prevent the game from crashing, it is also an alternative to RunService.Event:Connect():

while true do
    -- code
    RunService.Heartbeat:Wait()
end

They are usually most used on the Client to make effects on your screen not visible to others

1 Like

Alright thanks for that. I know RunService doesn’t reduce lag then.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.