Date: Fri, 9 Jan 1998 16:21:49 -0800 (PST) Message-Id: <199801100021.QAA00910@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Larry Swanson , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Why are screen pixels faster than double buffer? Precedence: bulk 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