   VBO locking is slow
  Hi, I spent last 2 days profiling my graphics engine and found out, that the vertex buffer objects's locking/unlocking operations are very slow compared D3D9. It slows down the engine a big time. Here is an example. I've got a dynamic vertex buffer that is beeing locked/unlocked every frame.The method method bellow takes 0.276943msbool CVertexBufferWrapper::Lock(void **data, bool discard, unsigned int izeToLock){glBindBufferARB(GL_ARRAY_BUFFER, m_VBID);GLenum access;if(m_writeonly) access = GL_WRITE_ONLY;else access = GL_READ_WRITE;*data = glMapBufferARB(GL_ARRAY_BUFFER, access);return true;}The D3D9 version of this methos, which does the same, takes about 0.00438915ms. The difference is quite frustrating. I've also tried to send all the data to the VBO at once using glBufferSubDataARB, but the result wasn't much better. Please, do you have any idea why is that so or is there any catch I should know about? Oh and I'm running Windows Vista and my graphics card is GeForce GTX260.   
  Bear in mind that in D3D, locking a managed pool vertex buffer (or default pool VB as writeonly or discard) will just return a pointer to re-allocated memory - it won't move anything across the PCI-E bus. The data is moved at a different time (Usually asynchronously after Unlock() is called). So profiling individual calls like this is usually a very bad idea. If you want to profile the GPU, use a GPU profiler like NVPerfHUD.   ;  Thank you for your answer. I was just trying to figure out, why is my engine's framerate two times slower when using OGL and found out that here is the "bug".0.2ms for locking a vertex buffer is just too much time. I spent hours searching the Internet and various source codes, but it looks like I'm not doing anything wrong.   ;  There are differences between GL and D3D and you have to live with them.If you call glUnmapBuffer and use the VBO immediately, it will be slow.More info about dynamic VBO herehttp://www.opengl.org/wiki/VBO_-_more#Dynamic_VBO;  Thank you, this seems to be very helpful.   