littensy / slither

🐍 A casual game with a soothing Catppuccin color palette
https://www.roblox.com/games/14162747150
MIT License
119 stars 9 forks source link

Investigate optimizations for dropped candy on death #91

Closed littensy closed 1 year ago

littensy commented 1 year ago

When a massive snake dies, or in certain cases with the /purge command, it's possible for a severe lag spike to occur. In the worst case I've observed with the /purge command, the server froze for a full second, and the client stuttered for a 1/4 of a second.

While the circumstances that cause lag on death may never actually come up, I'd like to investigate potential optimizations for it. Profile each step in the dropCandyOnDeath() function to identify the issue, and make sure actions are dispatched correctly.

littensy commented 1 year ago

I've marked this issue as wontfix because it is low priority right now, and I plan on checking it out later.