From: Ludvig Larsson Newsgroups: comp.os.msdos.djgpp Subject: superslow simpel rep stosl, why? Date: Mon, 19 Oct 1998 00:26:06 +0200 Organization: Faas-Goldhart Lines: 27 Message-ID: <362A6AFE.599F@club-internet.fr> NNTP-Posting-Host: toulouse-camichel8-77.club-internet.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: front6.grolier.fr 908762484 17633 195.36.147.77 (19 Oct 1998 02:01:24 GMT) NNTP-Posting-Date: 19 Oct 1998 02:01:24 GMT X-Mailer: Mozilla 3.01C-CLUB (Win95; I) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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). Are my calculations wrong(actually, I just want to clear a double-buffer for 640x480x16bit graphic mode(and a z-buffer, same size:)). Only clearing the double-buffer and the z-buffer(no drawings at all) slows everything down to about 80fps:( Anybody got an idea? Ludvig ps: the rep-stosl is inlined asm but anyway I use -O2.