Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Does the amount of code within a script affect performance?

Asked by 6 years ago

Would there be a difference if the code was spread out between multiple scripts rather having it all within one script?

2 answers

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

Nothing really changes honestly. It's just good practice to keep your script's more organized, split them up into different categories, use ModuleScripts, so it's easier for you, and other people to read. Organizing your scripts can also help you prevent bugs, and it can help you catch bugs more easily.

Having everything cluttered into one script can especially be bad if the script has hundreds or thousands of lines of code. And if you ever come across a bug that shows no error message while using one large script, it could take days or weeks to fix.

In short, it makes little to no difference, it's just more convenient.

0
Agreed. Modules make everything easier to use and less cluttered. Honestly, It's just preference based. User#20158 0 — 6y
0
My organization is pretty good, the script contains code relevant to one another. Was just worried about whether having too much code would cause a problem. Thanks for the response! PreciseLogic 271 — 6y
Ad
Log in to vote
1
Answered by 6 years ago

Yes, but only to a certain degree. Basically, having it in more scripts would affect performance a tiny bit, but not enough to drastically effect performance. You would see almost no difference from one or the other. However, that does change if you have 100+ scripts, but mainly what's inside the scripts matter. As long as its the exact same code, it wouldn't really affect performance at all.

Hope I could help, have a nice day. -REALTimothy0812

0
Ah, I see. Read the same on other forums, but wanted a personal confirmation. Thanks for the response! PreciseLogic 271 — 6y

Answer this question