All about optimization

The real optimization comes from looking at the micro profiler.

What is good to know is the balance between easy to maintain and readable code versus optimized code.
Deprecated functions aren’t often way slower than newer alternatives

1 Like

The reply from Roblox staff that I quoted says it doesn’t.

I don’t know what a DF is and what that even means.

It’s both. Too many Humanoids are harmful for game performance since it has to manage a lot of different characters at the same time, but the developer’s own coding and implementations also play a huge factor as well

4 Likes

some functions are better to use, for example findPartOnRay vs Workspace:Raycast, or task.wait() vs wait(), or maybe object like body movers - they are good but sometimes they goes badly

Yeah, they are nicer to use, but not necessarily faster. task.wait() is better because it can yeild for 1 frame minimum while wait() only yeilds for 2 frames minimum, can’t yeild for only 1 frame. For FindPartOnRay versus WorldRoot:Raycast, I do not know their performance, but I do know that in the case of the (almost deprecated) GetTouchingParts versus WorldRoot:GetPartsInPart, the newer alternative isn’t really faster

Discussion from Introducing OverlapParams - New Spatial Query API:

WorldRoot uses more optimized collision detection, however, it hasn’t been benchmarked against Region3. So how much faster? idk

For body movers, from what I remember (couldn’t find my sources), BodyMovers run at 240Hz regardless of the Adaptive Timestepping, which will reduce performance if you have a lot of them
The usefulness of the new AlignPosition and AlignOrientation objects can be argued…

1 Like

You can only have the HumanoidRootPart and the Humanoid in the server while the client will handle the rendering part of all bodyparts and animations

Hypothetically speaking, you can have 500 or more humanoids with proper implementation, such as unrendering the bodyparts after the humanoid is 500 studs away from the camera and stopping animations after the humanoid is 250 studs away from the camera

1 Like

Adding performance settings is great, even if roblox already adds that. This can make people be able to play your game at full graphics, for example, in my old pc I was able to play at max settings, but my pc hated the Depth Of Field effect and wasnt able to hit 60FPS, so having a setting to disable it would be good to be able to play it max graphics without compromising the other visuals

1 Like

well, you didn’t read this part anyways

I’m not really sure if this is still true or not, but I heard somewhere on the devforum, a long time ago, that neon was actually one of the fastest materials on roblox. Supposedly, it’s because roblox doesn’t perform specular / defuse calculations on it or something like that, but I don’t really remember.

1 Like

oh, maybe they changed that, it used to be laggy, maybe they fixed that, if yes, take this as outdated point

Thank you for your service! Will for sure use these tips in the future!

2 Likes