Using Stack vs A list in my pool script

Hello! I’ve made plenty pool systems for many games I’ve worked on. I started work on a new project and I created a pool system. However for some reason I decided to do some reading on pooling because I was interested in how other did their systems. I found that many used Stack over something like a list or an array list. I never used stack but what I want to know is… is stack better for performance in a pool system or something like a list or array would be better. Thanks!

Both the Stack and the List use a native array internally. It doesn’t really matter if you use a List or a Stack, though it depends on how you use them. For example Adding to the end of the list or removing from the end is as cheap as Stack push / pop. However if you remove the first element in the list you get a lot of overhead since every remove operation has to move all remaining elements around