title: Is accessing data in the heap faster than from the stack?
body: <p>I know this sounds like a general question and I've seen many similar questions (both here and on the web) but none of them are really like my dilemma.</p>
  
  <p>Say I have this code:</p>
  
  <pre><code>void GetSomeData(char* buffer)
  {
      // put some data in buffer
  }
  
  int main()
  {
       char buffer[1024];
       while(1)
       {
            GetSomeData(buffer);
            // do something with the data
       }
       return 0;
  }
  </code></pre>
  
  <p>Would I gain any performance if I declared buffer[1024] globally?</p>
  
  <p>I ran some tests on unix via the time command and there are virtually no differences between the execution times.</p>
  
  <p>But I'm not really convinced...</p>
  
  <p>In theory should this change make a difference?</p>