Date: Sun, 21 Dec 1997 14:11:24 +0200 (IST) From: Eli Zaretskii To: krizz cc: djgpp AT delorie DOT com Subject: Re: own flip screen function... In-Reply-To: <349BD8B7.186A617F@mailto.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.