Does organizing workspace objects into folders help reduce lag?


#1

I never organize my workspace objects into models or folders. I have thousands of individual parts in my explorer. I am wondering whether organizing those things into folders, will reduce lag.


#2

If you are running any code that loops through the workspace, organising objects into folders will improve performance by making the loop do less iterations. It mainly helps with keeping the workspace tidy though, doesn’t cause extra lag by leaving everything ungrouped (unless you are doing the above).


#3

What do you mean by “code that loops through workspace”? Can you provide some examples? Is it stuff like Workspace:FindFirstChild() ?


#4

Loops that iterate through children, such as:

for i, v in pairs(workspace:GetChildren()) do

will improve in performance

That said, this is assuming you’re doing this a LOT within a short period of time. This should not be a big source of lag in a game. In fact, unless you’re iterating many times in a short period of time tidying up workspace or wherever you’re iterating through will show little performance increases. If your game is experiencing lag, there are likely other issues at hand. Usually the problem is the algorithm itself, and what I mean by this is many times the method people use as solutions to solve their problems is inefficient.


#5

I don’t think changing the hierarchy of objects within the Workspace will ever change lag. However, I would recommend organizing things into models and such for your own sanity.

I typically try to name nearly every single part in my game, and organize them into models and sub-models.


#6

Does not reduce lag… however what one would you rather use and work with? Trust me, your coder or customer would love you for keeping your workspace organised.

gro

K2


#7

I’ve tried both and never saw any difference in performance. However, a clean workspace will make game development much easier on your team, if you’re working with other people.


#8

As to the best of my knowledge, No. It doesn’t help.

But when I first started making games, I never grouped or did anything so I just have a zillion parts in my workspace and it was incredibly hard to find anything. So, even though it won’t improve performance, it’ll make it easier for you to find things and it just looks cool to have folders. :sunglasses:


#9

i do not think so, I guess it dont very reduce the lag. because it still depend on which script did you put and how many codes does it have. i guess it dont reduce the lag.
you need a plugin or a Superior Script to reduce the lag


#10

Okay, maybe it does not help with performance but do you really want to scroll through thousands of parts when trying to find something??

What if you needed a script to do something

workspace.Part will select a random part

what if you need to change something oh good luck with that if you didn’t rename or group them.

Better performance or not you should always keep your workspace clean if you want to work with a Scripter & not have problems.