Results 1 to 5 of 5

Thread: VBO perfs analysis

  1. #1
    Member Newbie
    Join Date
    Jun 2004

    VBO perfs analysis

    i wrote a little benchmark to compare vbo and a basic loop of glvertex3fv.
    I'm a bit deceived by the results :
    for a loop of 100,000 points : fps = 59.7
    for a loop of 1,000,000 points : fps = 19.9
    for a vbo with 100,000 : fps = 62.5
    for a vbo with 1,000,000 : fps = 31.2

    For 100,000 points I got no gain from using VBO... isn't it strange ?

    I also measured the time needed for my glrender function in both cases. For a loop of glvertex3fv, it's very slow (all the time is spend there).
    But for the VBO, this is very fast, time is not spend there. What does that mean ?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Naarn, Austria

    Re: VBO perfs analysis

    That means the CPU is not the bottleneck

    One great advantage of VBOs (and to some degree normal vertex arrays, too) is that you save a lot of CPU time. If your CPU has nothing else to do, you won't notice a difference because the GPU is the limiting factor.

    As soon as you do different tasks on the CPU, like calculating physics or AI, you will notice a performance drop because of the time "wasted" in the drawing function, while with VBOs the drawing function immediately returns and the GPU is busy drawing while the CPU does something else...

  3. #3
    Member Newbie
    Join Date
    Jun 2004

    Re: VBO perfs analysis

    thanks for this clear answer.

    My next question is about mixing some drawings with VBO and others with glVertex3f.

    For example, i draw in the following order :
    1.few vertices with glvertex3f
    2.a big array of vertices using vbo
    3.few vertices with glVertex3f

    What's going to happen ? Will the third step wait for the vbo to be finished ?

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jan 2004

    Re: VBO perfs analysis

    I'm no expert on the hardware details, but AFAIK, the CPU dumps geometry etc. into the same pipeline as the VBO data ends up in.

    So what I expect is this:
    1. (glVertex stuff) CPU sends commands to pipeline, GPU processes them really quickly, pipeline remains virtually empty.
    2. (VBO) CPU sends one command to the pipeline, but that places a lot of work into the pipeline. CPU can continue, but the GPU has a backlog.
    3. (more glVertex stuff) CPU sends commands to the pipeline, behind the backlog of the GPU.
    4. CPU does other stuff/waits for buffer swap - while the GPU gets some time to finish work.

    In other words: all calls (except for synchronisation calls) return as soon as their commands have been buffered. But everything is still effectively performed in the same order.

    So you save a lot of CPU time, and if the CPU is the bottleneck that means you increase the rendering speed, but the results are correct.

    Note: if you have software fallback at some point, of course the pipeline would have to be flushed, if it is used at all.

    But even if there was a need to flush the pipeline before the glVertex calls were issued, it would still be faster. Simply because of the function call overhead.

  5. #5
    Member Contributor
    Join Date
    Apr 2002

    Re: VBO perfs analysis

    A question related to this topic: Display lists behave identically as VBOs in that sense, don't they? I mean that glCallList is a non-blocking command, so the CPU can do its work after the call while the GPU is doing its own.

Similar Threads

  1. Perfs: using 1 vs. multiple samplerBuffer objects?
    By fred_em in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 12-23-2011, 08:38 AM
  2. Asynchronous read-back perfs with PBO
    By Cyril in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 10-26-2004, 04:47 AM
  3. ARB_fp perfs again
    By SeskaPeel in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 10-21-2003, 10:21 AM
  4. Fragment program perfs
    By SeskaPeel in forum OpenGL: Advanced Coding
    Replies: 18
    Last Post: 08-26-2003, 10:20 AM
  5. GL performance analysis?
    By markfcsl in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 06-02-2003, 06:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean