Path: chuka.playstation.co.uk!news From: Alex Herbert Newsgroups: scee.yaroze.freetalk.english Subject: Optimisation Date: Fri, 27 Feb 1998 23:27:44 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 38 Message-ID: <34F74BF0.54FDD9A@ndirect.co.uk> References: <34F1D481.5FFF@mdx.ac.uk> Reply-To: aherbert@ndirect.co.uk NNTP-Posting-Host: dialin2-17.ndirect.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.04 [en] (Win95; I) Hi all. There are some very important points regarding optimisation which no one seems to mention. (Maybe it's just too obvious.) Remember that the PSX processing is parallel. Your code and drawing are happening at the same time, and both have to complete before frame switching. (Yes, yes, I know you already know this but it's relevant.) It is not usual that both the code and drawing take the same time to complete, hence the need for DrawSync(). So why waste time optimising the part which finishes first? It gains you nothing. I call VSync(1) before DrawSync to determine the code execution time, and then VSync as normal before switching buffers. I then keep peak values for these times (which are reset every second or so) as it is peaks that lead to slowdown and juddering. If my code always completes before the drawing, then I know my code is as optimised as it needs to be. I could make it quicker, but I'd still have to wait for drawing to complete, so what's the point? In general, I'd suggest that this is usually the case, especially for 2D work. If the code is overrunning the drawing, then it's time to optimise the code. (Unfortunately the above timing method will not tell you by how much the code is overrunning - DrawSync will return immediately and the two timings will be close if not identical.) If the drawing is taking too long, then that's what needs to be optimised. Reduce: use of semi-transparency, use of rotated/scaled sprites, bit-resolution/size of textures, etc. Ah well. I've said my bit, and I hope this is of use to someone. Alex.