Path: chuka.playstation.co.uk!news From: "John \( QuietBloke \)" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Daft Question [long] Date: Mon, 27 Aug 2001 22:14:28 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 39 Message-ID: <9med8s$1sb18@www.netyaroze-europe.com> References: <9loc6a$p3k2@www.netyaroze-europe.com> <9loeu8$p3k3@www.netyaroze-europe.com> <01c1297e$8cb6e8a0$LocalHost@pal-s-omnibook> <9lrqqf$3j63@www.netyaroze-europe.com> <01c129ca$a5a6f700$d81fe4d5@pal-s-omnibook> <9m1d9c$b2i7@www.netyaroze-europe.com> <01c12ceb$fba64880$9709e4d5@pal-s-omnibook> <9m9c88$ioj5@www.netyaroze-europe.com> <01c12edc$cc2bf440$991fe4d5@pal-s-omnibook> <9me1g1$1sb13@www.netyaroze-europe.com> <9meajl$1sb17@www.netyaroze-europe.com> NNTP-Posting-Host: host213-122-33-159.btinternet.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Nice one Jon, That certainly seems to suggest my solution should be pretty nimble. Where'd you get that info from .. if you dont mind me asking Cheers John (Quietbloke) "Jon Prestidge (Jon@surfed.to)" wrote in message news:9meajl$1sb17@www.netyaroze-europe.com... > > I have absolutely no idea how fast an integer divide is > > ... it's only one CPU instruction... it may take an extra clock cycle or two > longer to execute than a logical shift operation for example, but it's > still very, very quick. > > > cant be any slower then the several if's > > .... one integer divide should be a lot quicker that several IFs. The Risc > chip can only compare against zero so unless you're IF compares a value > against zero the IF statment will be two CPU instructions ( a subtract and a > compare-and-branch ). > > A big over head is the loading and unloading of variables to CPU registers > from memory and back again...if you can arrange small performance critical > routines to use just a few variables (or just two if you can manage it) then > it's a lot quicker because there's more chance of the variable staying in a > CPU register and not being loaded back and forth to memory. > > Jon > >