delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/09/19:23:42

Date: Fri, 9 Jan 1998 16:21:49 -0800 (PST)
Message-Id: <199801100021.QAA00910@adit.ap.net>
Mime-Version: 1.0
To: Larry Swanson <laswanson AT mwci DOT net>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Why are screen pixels faster than double buffer?

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019