Hey, i'm trying to learn about performance optimization on roblox and i was wondering something
I never faced any performance issue until yesterday, spamming a remoteevent that was passing my whole player unit data 10 times cus i was giving 10 units made my game freeze and ping went to 700+ms which made me realise i should learn about this as fast as possible to avoid rewriting a huge part of everything i did in a few weeks
So here is my question :
Performance wise, what is the best way to deal with all the data my client need (display etc), the remotes and how the server should pass the data ? I also heard about things like Memory Leaks etc, what are these ? how can i see if there is one and how to prevent ?
As example, right now i'm using Local/ModuleScripts for my GUIs, LocalScript get the data in a variable with RemoteFunctions and then when its a function i will need from different scripts i use ModuleScripts or else i keep it in the LocalScript. Then i call the function and pass the data this way
in this scenario, what should i do ? Stay like this, = nil the data if i dont need it anymore ? Make a Module that store the data so i just refresh it using RemoteFunctions and specific target so only 1 script have all the data and it doesnt duplicate in each ? (im pretty sure its the last)