Date: Thu, 21 Oct 1999 13:53:37 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: Mouse Events Problem In-Reply-To: <7ul9ig$e2f$1@solomon.cs.rose-hulman.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 20 Oct 1999, Damian Yerrick wrote: > > Anyway, you should never try to optimize the code before you wrote it. > > Once you get the program working, if it runs too slow, profile it and see > > where it spends most of the time. More often than not, you will be > > surprised by what the profiler shows. Which means that optimizing early > > generally means you optimize in the wrong place. > > Any good HowTo pages on optimization? On the net, I don't know. A good book about optimizations is "Writing Efficient Programs" by Jon Bentley (Prentice-Hall, 1982). Some of the material there is obsolete, because compilers are so much better now in optimizing code; but the principles still hold. Anyway, the two most important rules of optimization are: Rule no.1: Don't do it. Rule no.2: Don't do it yet. In fact, *because* the compilers are so good in optimizing, I think you should generally consider optimizations later in the program development cycle, and only if there's a real problem in program performance.