csanyk
Member
Looking for a well-coded demo showing how to do instance pooling in GMS.
For the uninitiated, instance pools are a design pattern that is useful for performance optimization when you are constantly creating/destroying lots of intstances. Rather than creating and destroying instances every step of the game, you create a "pool" of (deactivated) instances, as many as you would need for the game, ahead of time, which you manage by activating/deactivating as needed. When you'd ordinarily destroy the instance, you simply deactivate it, to re-use it when you need another one.
As long as activation/deactivating is cheaper than creation/destruction in terms of CPU, it is beneficial to performance.
For the uninitiated, instance pools are a design pattern that is useful for performance optimization when you are constantly creating/destroying lots of intstances. Rather than creating and destroying instances every step of the game, you create a "pool" of (deactivated) instances, as many as you would need for the game, ahead of time, which you manage by activating/deactivating as needed. When you'd ordinarily destroy the instance, you simply deactivate it, to re-use it when you need another one.
As long as activation/deactivating is cheaper than creation/destruction in terms of CPU, it is beneficial to performance.