I have a server sided function thats pretty heavy and it runs 5x a second, I calculated how long it takes but I’m not sure how much of a impact this will actually have.
On average it takes about .0005 seconds, it can be much higher or much lower but this is a fair average, it runs 5 times a second so about 0.0025 total time is lost doing this a second, how much will this strain my server resources? Or does it depend on how the function is coded (I loop through massive models and Get:Attribute() on each part)
script analysis is a tool used for syntax if you mean script performance its about .2% and 1/s (I dont know that actual importance of these numbers, all I know is higher is bad )
I don’t think im qualified enough to answer this but I don’t think lua is made for computational heavy stuff but you can maybe try to optimize it.Also can you show example code?
You could just attach an AttributeChangedEvent to the parts you’re summing up so that when any of them change, you can quickly calculate the new value.
the attributes or the number of items changes quicker than .25x a second
worth does change thats the entire reason I am doing this
To accurately get the value of a constantly changing mass of parts
I am not looking to redesign this entire system I am simply trying to figure out the performance impact this method has on servers, if its poor then yes I will try to redesign it, if its not then I will leave it.
In real game engines we’d create a gpgpu program with kernels (in this context a kernel is like a tiny program which runs on parrallel) but compute shaders dont exist in roblox as long as you arent calling every single second it I dont see a problem, really.
This sounds more worrying than actually calculating the whole assembly mass.
Anyways, what I would do is stress test the system. Spawn like 10, 100, 1000 assemblies and see how the server performs. How many assemblies can it handle? If it handles more than you need then that’s great, otherwise you might need to drop recalculation to 4, 3 or 2 times per second.