title: Better to create an empty list or return null when dealing with a LARGE number of objects per frame in a game?
body: <p>I'm basically asking which is more costly on the CPU.</p>
  
  <p>The situation is that I have about 40-400 particles on the screen at any one given time.  Each particle has a List of ParticleAI which have an Update() method that returns a List of newly created Particle objects, if any.  Now, since this game is being made for mobile, efficiency on the processor is key.  I was wondering if it is more costly to create something between 100-2000 Lists every frame (at 60FPS) which may be empty, which is the way I have it now, or to return nulls and do a null check for each AI.  For some reason, in my brain it seems constructing a List object would take more processor time than simply returning a null and then doing a boolean check for it.  Am I wrong in my assumption?  </p>
  
  <p>I have looked at other similar questions, such as <a href="https://stackoverflow.com/questions/1969993/is-it-better-to-return-null-or-empty-collection">this one</a>, but it doesn't seem to answer my question.  I get that best practice is to return empty, but I am not making this game for anyone else to edit, and so I know that a null will never be received unexpectedly.  I need to know in pure processing terms which is better, simply because of the sheer number of particle objects being created at once.</p>
  
  <p>Thanks in advance!</p>
  
  <p>EDIT:</p>
  
  <p>Just realized something which may work better.  Would it be a better idea to (instead of creating a new list and returning it for every particleAI every frame) create each particleAI's return list at construction and then clear it at the beginning of each Update() phase?  That almost seems like it would be the best option. </p>