title: Cost of static memory allocation vs dynamic memory allocation in C
body: <p>I am very interested to know what is the preferred method of memory allocation <code>static vs dynamic</code> is good for performance (e.g., running time) when you know the exact number of objects/items in <code>C</code> on <code>Linux</code>. Cost for a small number of objects (small amount of memory) and as well as for a large number of objects (huge amount of memory). </p>
  
  <p><code>e.g., type A[N]</code>   vs <code>type *A = malloc(sizeof(type) * N)</code></p>
  
  <p>Please let me know. Thank you.</p>
  
  <p>Note: We can benchmark this and probably know the answer. But I would like to know the concepts that explain the performance differences between these two allocation methods.</p>