In programming languages, one of the most time-consuming things for the computer to do is deal with memory allocation. It's fairly inefficient and, depending on the resources being used, could slow down your game drastically.
A common element found in shooter games, or any game with explosions or bullets, is to create and destroy many objects in quick succession. Take, for example, the Touhou Project series of games, where there are many bullets being fired by both the player and enemies. When done in the simplest manner, calling new
when you want to create a bullet and delete
when you want to remove it will cause our game to lag or freeze over time.
To prevent this from happening, we can make use of the Object Pool pattern.