title: glDeleteBuffers slower than glBufferData
body: <p>I'm having a bit of performance issue in my iOS/Android game where several VBO's have to be updated every once in a while. After profiling my game it turns out that glDeleteBuffers() takes up to 7ms per VBO update. This of course results in a hiccup when frames normally take only 4 ms to render. </p>
  
  <p>Here's the part where I update my VBO:</p>
  
  <pre><code>Chunk* chunk;
  pthread_join(constructionThread, (void**)&amp;chunk);
  building = false;
  
  if (vboID)
  {
      //takes 7 milliseconds
      glDeleteBuffers(1, &amp;vboID); 
      vboID = 0;
  }
  if (offset)
  {
      glGenBuffers(1, &amp;vboID);
      glBindBuffer(GL_ARRAY_BUFFER, vboID);
  
      //takes about 1-2 milliseconds, which is acceptable
      glBufferData(GL_ARRAY_BUFFER, offset * 4, constructionBuffer, GL_STATIC_DRAW);
  }
  </code></pre>
  
  <p>where offset is an instance variable is basically the size of the new VBO, which is quite variable. vboID speaks for itself, I guess ;)</p>