Newsgroups: comp.os.msdos.djgpp From: Elliott Oti Subject: Re: superslow simpel rep stosl, why? Sender: usenet AT phys DOT uu DOT nl (News system Tijgertje) Message-ID: In-Reply-To: <362A6AFE.599F@club-internet.fr> Date: Mon, 19 Oct 1998 15:46:12 GMT X-Nntp-Posting-Host: ruunf0.phys.uu.nl Content-Type: TEXT/PLAIN; charset=US-ASCII References: <362A6AFE DOT 599F AT club-internet DOT fr> Mime-Version: 1.0 Organization: Physics and Astronomy, University of Utrecht, The Netherlands Lines: 31 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Mon, 19 Oct 1998, Ludvig Larsson wrote: > Just a question. > > My clear-buffer routine is so slow. > > I want to fill about 600.000 bytes in onepart of the memory > with a constant(not screen). > On my AmdK6-2 300mhz it takes 0.006 sec. which gives about > 100millions of bytes/sec. Quite a bit right! > But should it take 3 clockcykles to clear each byte? > I'm clearing quadwords... > > I'm using asm(rep stosl). > > Is this normal? Is it a sort of cache thing?(my amd has 64kb on-chip, > 512 kb burst and the rest is 100mhz memory). If you have 10ns memory (burst write times) then your maximum fill rate cannot exceed 0.002 sec for a 153,600 dword aligned buffer, assuming the memory behaves according to spec. On an aligned dword buffer, using rep stosl, your times are probably the fastest the machine can produce. Cheers, Elliott Oti http://www.fys.ruu.nl/~oti Eh? Where's my sig?