I recently learned the power of part caching to save server power and make things run faster and was wondering if the same concept applies to sounds?
My current method of playing sounds has been to:
Clone the sound → set play on remove to true (if it isn’t already) → destroy the sound.
But it would be pretty easy to create a ‘cache’ of sounds that just has a bunch of copies of the sound ready that just moves them over and plays them, then moves back when they’re done being played. Would this be a good implementation for sounds that get played a lot (like machine gun fire)?
Generally, leaving things in memory is always faster than destroying it and creating it again everytime.
Let me make it a question to make it more obvious:
Is it faster to cache things in memory than destroying the cache and caching the same thing again every time?
Now I’m not familiar with how sounds work in roblox studio but if there is a volume adjuster then setting it to 0% when not needed and 100% when you need to use it is provably how I would do it.