delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/05/15:14:44

Date: Fri, 5 Jul 96 15:12:07 EDT
From: Mihai Moise <moisemih AT ift DOT ulaval DOT ca>
Message-Id: <9607051912.AA02363@vonneuman.ift.ulaval.ca>
To: djgpp AT delorie DOT com
Subject: Re: What is the quickiest way to clear memory?

>> Pin F. Sun wrote:

>> I am trying to find out a quick way to clear memory. I used memset or
>> bzero function, but they are way too slow. I am trying to use assembly
>> language...

> memset() uses rep stosd. you don't get much [quicker] than that!

While this is true, it is also true that string instructions are not
recommended for superscalar processors, like the Pentium. I believe
that in the user's manual Intel warns against using them. On the PPC 604,
they are slower than sti's.

All the same, surprisingly enough, ANY method of transfering data --
memcopy, optimized assembler, loops ( rolled! )  -- is just as fast on 
the pentium ( try it! ). I believe what is really measured is memory
access speed as the pentium writes back its caches.

Pin F. Sun wrote:

> As I know, data transfering to video ram is about 5-6 times slower than

Hmmmm.... check your intelligence ( i.e., source ).

As for clearing video ram, your local friendly graphics co-processor
might have a function for that :-).

- Raw text -


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