Mail Archives: djgpp/1998/01/09/19:23:42
At 04:51 1/8/1998 -0600, Larry Swanson wrote:
>I recnetly started profiling my code using the rdtsc command in a NASM
>procedure. I was suprised to see exactly how many cycles things took to
>happen. For example:
>
>-----Procedure--------------------------How many
>Cycles---------------------
>Pixel to screen: 250 cycles
>Pixel to double buffer in ram 1500 cycles
>Fill screen 16bit 290000 cycles
>Fill RAM double buffer 330000 cycles
>
> As you can see, it takes 8 times as long to plot to memory. I'm just
>curious as to why, because I've always read that VRAM is slower than
>RAM. Also, doesn't 250 cycles seem like a long time for a pixel plot
>any way? I always thought it would be at least less than 75.
Considerable overhead is involved in function calls, etc, and the `rdtsc'
instruction itself. You'll get more accurate with the bulk measurements.
Depending on how you access memory, it could be that your RAM accesses are
somehow misaligned.
However, I'm no hardware guru, so don't quote me on that. :)
Nate Eldredge
eldredge AT ap DOT net
- Raw text -