Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!ucsd!ucrmath!dimaggio!rhyde From: rhyde@dimaggio.ucr.edu (randy hyde) Newsgroups: comp.sys.apple2 Subject: Re: CRCs Message-ID: <13959@ucrmath.ucr.edu> Date: 26 Apr 91 19:01:55 GMT References: <13688@ucrmath.ucr.edu> <15915@smoke.brl.mil> <13769@ucrmath.ucr.edu> <15953@smoke.brl.mil> Sender: news@ucrmath.ucr.edu Reply-To: rhyde@dimaggio.ucr.edu (randy hyde) Lines: 36 >>> Most of the execution time is spent in a small percentage of the code. Ah, the good old 90-10 rule. I subscribe to this rule in totality. The only problem is finding that 10% Most people assume the 10% (responsible for 90% of the execution time) is all together in one big clump. Extract that and rewrite it in assembly and your program magically runs almost as fast as a pure assembly language program. I've fallen into this trap before; several times in fact. That's why I'm so strong on assembly today. I truly believe that 10% of the code is responsible for 90% of the execution time. It's just that that 10% consists of 0.5% here, 0.2 % there, 1% in that corner, 0.74% somewhere else, and so on. Often the slow code is intermixed with the fast code in such a way that you wind up rewriting a large part of the program in assembly anyway. I know, I've done this so many times in the past on applications that were written in C or Pascal and needed a considerable speed-up. Two projects, in particular, come to mind. One was an editor, the other was a runoff type program. On the runoff program I spent as much time recoding portions of the program as I did writing it in Pascal in the first place. It ran only twice as fast when I was done, which wasn't fast enough. I re-wrote it in assembly and it ran about ten times faster than the hybrid version. I had similar results with the editor. BTW, rewriting it in assembly took less time than hacking up the Pascal code with assembly. Now I'm talking about programs on the order of 10,000 to 50,000 lines. I wouldn't make these same claims for a 1,000,000 line program. OTOH, I wouldn't work on a 1,000,000 line program, either. BTW, I have Bentley's "Writing Efficient Programs" and I assign it in a couple of my classes. Definitely a good book regardless of your choice of language.