home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.arch:10582 comp.lang.misc:3570
- Path: sparky!uunet!spool.mu.edu!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!ames!agate!doc.ic.ac.uk!uknet!lsl!snail
- From: snail@lsl.co.uk
- Newsgroups: comp.arch,comp.lang.misc
- Subject: <None>
- Message-ID: <1992Nov10.172402.2628@lsl.co.uk>
- Date: 10 Nov 92 16:24:01 GMT
- References: <1992Oct23.004313.29196@ntuix.ntu.ac.sg> <1992Oct29.153514.22927@yrloc.ipsa.reuter.COM> <BwxsF6.3DF@mentor.cc.purdue.edu> <1ct342INNd4k@agate.berkeley.edu>
- Organization: Laser-Scan Ltd., Cambridge
- Lines: 41
-
- In article <1ct342INNd4k@agate.berkeley.edu>, jhauser@pine.CS.Berkeley.EDU (John Hauser) writes:
- [code example deleted]
- > The second piece of code is easier to understand and no slower than the
- > first. Depending on the compiler, it's likely faster.
-
- Absolutely
-
- > Exactly how much duplication to tolerate can be an engineering decision.
- > However, if I hear you right and you're trying to get every possible ounce
- > of speed out of a single subroutine, you'd be wise to trade off an increase
- > in program size for an increase in the distance between branches and a
- > reduction in the number of `goto's.
-
- There's a guy here, (as raster handling expert) and he needs to handle data in
- many word sizes, but do the same operation (filtering, shearing etc) so he
- has several routines and in each routine is a switch statement for each data
- size. Recently the compiler fell over... the branches in the case statements
- were over 32K in length! Typical of a 32 bit machine that, 16 bit branch
- offsets. We had a good laugh at that. However, he's done a slight change so
- that doesn't happen now, and the code performance before and after is excellent
- - don't worry about large switch/case statements, if performance is what you're
- *really* after.
- > As long as you don't bloat your code so
- > badly that it won't fit in the on-chip cache, you can improve both the
- > speed and the structure of your code this way.
-
- Not knowing how big the cache on a MIPS R3000/SPARC 2/HP SNAKE PA CHIP/RS 6000
- /ALPHA and they're all different, we just go ahead and do the code anyway.
- >
- > Just my $10 worth.
- >
- > ----------------------------------------------------------------------------
- > Boycott redwood. Boycott Louisiana-Pacific. Keep the forests. YYYYYYYYYYY
- > John Hauser---jhauser@cs.berkeley.edu YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
-
- Just my new 10p (horrible coin) worth
- --
- snail@lsl.co.uk
-
- You Have To Remember, You Need To Beleive,
- The Time Has Past, Dust In The Leaves.
-