Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin/Commands/Core/Process.lua | Optimizations #540

Merged
merged 8 commits into from
Oct 30, 2021
Merged

Admin/Commands/Core/Process.lua | Optimizations #540

merged 8 commits into from
Oct 30, 2021

Conversation

fxeP1
Copy link
Contributor

@fxeP1 fxeP1 commented Oct 26, 2021

Admin:
switched some string metamethods
Cached to some tables that could possibly get huge (depends if on settings and datastores)

Commands:
Switched to getEnv instead of giving the commands env.

Core:
GetDataStore will now check if you can actually use DataStores in studio first before setting to prevent a big warn pileup if they are disabled.
Switch of next to pairs
More caching to datastores (datastore entries can get really big in size overtime so having it be pretty fast is essential)

Process:
OnSpawn and OnJoin will run synchronous to prevent yields to the function.

Service:
Changing of string metamethods.

`Admin`:
switched some string metamethods
Cached to some tables that could possibly get huge (depends if on settings and datastores)

`Commands`:
Switched to getEnv instead of giving the commands env.

`Core`:
`GetDataStore` will now check if you can actually set Data in studio first before setting to prevent a big warn pileup if they are disabled.
Switch of `next` to `pairs`
More caching to datastores (datastore entries can get really big in size overtime so having it be pretty fast is essential)

`Process`:
`OnSpawn` and `OnJoin` will run synchronous to prevent yields to the function.

`Service`:
Changing of string metamethods.
@@ -1028,8 +1044,9 @@ return function(Vargs)
end;

IsBlacklisted = function(p)
for i,list in next,Variables.Blacklist.Lists do
if Admin.CheckTable(p, list) then
local CheckTable = Admin.CheckTable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to store in variable when it is only being used once

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depends on how big the blacklisted table could be and instead of indexing the admin just to get checktable possibly for a huge amount could take a toll on some performance.

MainModule/Server/Core/Core.lua Outdated Show resolved Hide resolved
@@ -591,8 +592,9 @@ return function(Vargs)
if Variables.Whitelist.Enabled then
local listed = false

for listName, list in next,Variables.Whitelist.Lists do
if Admin.CheckTable(p, list) then
local CheckTable = Admin.CheckTable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to store in variable when it is only being used once

fxeP1 added 7 commits October 27, 2021 05:23
`Service`:
Service will setfenv inside the called func to prevent some reduced setting of a functions env.

`Server`:
Removed a few useless tables (LSP said they weren't used)
switched from next to ipairs/pairs

`Client`:
Localized the Localized.
Switched from next to ipairs/pairs
Prevented WaitForChild from outputting a warning if ever possible.
@Sceleratis Sceleratis merged commit c563d10 into Epix-Incorporated:master Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants