delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/21/07:11:38

Date: Sun, 21 Dec 1997 14:11:24 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: krizz <krizz AT mailto DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: own flip screen function...
In-Reply-To: <349BD8B7.186A617F@mailto.de>
Message-ID: <Pine.SUN.3.91.971221140544.8399Z-100000@is>
MIME-Version: 1.0

On Sat, 20 Dec 1997, krizz wrote:

> i think memcpy is very slow.

I'd suggest to time the functions and look at their machine code as 
produced by GCC (use the -S switch) before you decide to roll your own 
version.

`memcpy' is actually very fast, *if* you compile with optimizations (-O2 
switch to gcc).  In many cases, it expands to inline assembly that uses 
the same movesd instruction that you were trying to use in your code.  
Even if it doesn't produce inline assembly, the code of `memcpy' itself 
uses such a fast loop, so you only pay the overhead of a function call.

However, when you move buffers to the screen, your speed is limited by 
the system bus and the performance of your SVGA.  Most of the time, the 
CPU is stalled while it waits for the bus and SVGA to do their thing.

- Raw text -


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