C99 variable length automatic array performance

Posted by aaa on Stack Overflow See other posts from Stack Overflow or by aaa
Published on 2010-06-10T22:58:32Z Indexed on 2010/06/10 23:23 UTC
Read the original article Hit count: 199

Filed under:
|

Is there significant cpu/memory overhead associated with using automatic arrays with g++/Intel on 64-bit x86 linux platform?

int function(int N) {
    double array[N];
  • overhead compared to allocating array before hand (assuming function is called multiple times)

  • overhead compared to using new

  • overhead compared to using malloc

The range of N may be from 1kb to 16kb roughly, stack overrun is not a problem.

© Stack Overflow or respective owner

Related posts about c

    Related posts about Performance