From: David Chase <chase@world.std.com>
Subject: Re: Final kick at the "Merced Guessing Game"
Date: 1997/10/08 [thread overview]
Message-ID: <343BD179.4B0A@world.std.com> (raw)
In-Reply-To: 61g30t$o2n@news-rocq.inria.fr
Robert Harley wrote:
> I think your problem is that C is too flexible for you. It doesn't
> wrongly assume that there is one way of laying out and accessing
> arrays that is appropriate for all purposes. For instance you can
> choose a flat array, 'float *a', or a hierarchy like 'float ***a'.
C's flexibility has two problems:
1. it is mandatory.
2. it is confined to a set of uninteresting choices.
In C, can I choose to have the compiler autoparallelize my dusty
deck onto a 16-processors SparcServer 2000? In C, can I choose to
have my loops automatically interchanged for better cache use?
How about cache blocking? Any automatic vectorizers for C?
Oh, I guess I don't get those choices.
Given detailed knowledge of a particular chip, working in C,
my attempt at a too-big-for-the-cache double-precision matrix
multiply obtained only 30 Mflops (this was on a 50 or 55 Mhz
SuperSparc, back in 1994). The code in Fortran was about
1/10th the size, and ran at 34 Mflops. Both bits of code
contained some hand-optimization, but the C code had much
more (the Fortran was simply blocked for cache locality;
the C code was blocked for both register and cache locality,
as well as software pipelined).
Keep in mind that most C programmers don't know how to
software-pipeline a loop. Most of them are not sure how
to do register blocking. Most of them are not exactly
sure how many double-precision registers are on the chip
they are using. Most of them don't know the size of the
cache on the chip (chip? how about box, since ecache sizes
can vary). I'll bet most of them don't know what cache
blocking is. And, if they do, I'll bet they forget to check
to see if the ecache is physically-indexed direct-mapped
or not, and whether the OS is taking care to "color" virtual
pages so that non-colliding virtual addresses will also be
non-colliding in the external cache.
This stuff is awful to do by hand.
And this, of course, was just matrix multiplication, it
wasn't something tricky to optimize for locality, like
GEPP or QR (for QR, so I am told, you must use a
different algorithm to get your factorization if you
wish to block it for locality). This code is really
tedious to write.
So, this flexibility gets me what? The privilege of writing 10
times as much code, that runs 10% slower, and is harder to port,
understand and maintain?
It is mind-boggling to me how persistently ignorant some people
working in C are. Someone told you once that C is the fastest
language, and it grabbed your brain. Maybe it feels like it
just must be fast, because you work so hard to make it fast.
Maybe you think that all high-level transformations alike,
that since (e.g.) SETL generally runs pretty slowly, that
all languages which are not "close to the machine" must
therefore run slowly. It is not so.
--
David Chase, chase@world.std.com
next prev parent reply other threads:[~1997-10-08 4:00 UTC|newest]
Thread overview: 207+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-10-08 4:00 Final kick at the "Merced Guessing Game" Robert Harley
1997-10-08 4:00 ` brianh
1997-10-08 4:00 ` boo
1997-10-09 4:00 ` Eric Hildum
1997-10-09 4:00 ` brianh
1997-10-11 4:00 ` Jan Vorbrueggen
1997-10-12 4:00 ` boo
1997-10-13 4:00 ` Carl Perkins
1997-10-13 4:00 ` Michael Williams
1997-10-13 4:00 ` Craig Burley
1997-10-13 4:00 ` Paul Rubin
1997-10-13 4:00 ` Craig Burley
1997-10-13 4:00 ` William Clodius
1997-10-14 4:00 ` Richard A. O'Keefe
1997-10-14 4:00 ` Michael Williams
1997-10-14 4:00 ` Richard Black
1997-10-15 4:00 ` Michael Williams
1997-10-15 4:00 ` Dr. Richard Black
1997-10-16 4:00 ` Richard A. O'Keefe
1997-10-15 4:00 ` Craig Burley
1997-10-18 4:00 ` Bruce Hoult
1997-10-14 4:00 ` Shankar Unni
1997-10-15 4:00 ` Achim Gratz
1997-10-15 4:00 ` Richard A. O'Keefe
1997-10-15 4:00 ` Paul D. DeRocco
1997-10-15 4:00 ` William Clodius
1997-10-15 4:00 ` Joe Buck
1997-10-16 4:00 ` Richard A. O'Keefe
1997-10-16 4:00 ` Craig Burley
1997-10-17 4:00 ` Shankar Unni
1997-10-15 4:00 ` Paul Hsieh
1997-10-13 4:00 ` boo
1997-10-15 4:00 ` Craig Burley
[not found] ` <623ek6$ef5$1@news.iastate.edu>
1997-10-16 4:00 ` Craig Burley
1997-10-16 4:00 ` SimGraphics
1997-10-17 4:00 ` Craig Burley
1997-10-17 4:00 ` William Clodius
1997-10-19 4:00 ` Craig Burley
1997-10-17 4:00 ` David Chase
1997-10-18 4:00 ` Victor Yodaiken
1997-10-20 4:00 ` Eric Hildum
1997-10-18 4:00 ` Peter L. Montgomery
1997-10-19 4:00 ` Craig Burley
[not found] ` <3456700e.14141203@news.demon.co.uk>
1997-10-28 5:00 ` Dirk van der Knijff
1997-10-20 4:00 ` Richard A. O'Keefe
1997-10-20 4:00 ` Peter L. Montgomery
1997-10-16 4:00 ` Flexible Choice of Language (Nothing to do with: Final kick at the "Merced Guessing Game") Ian Dall
1997-10-16 4:00 ` Craig Burley
1997-10-17 4:00 ` Richard A. O'Keefe
1997-10-17 4:00 ` Keith Adams
1997-10-17 4:00 ` John Bayko
1997-10-17 4:00 ` [Reposted due to Enlow UCE cancel]: " John Bayko
1997-10-20 4:00 ` Paul D. DeRocco
1997-10-18 4:00 ` Kelly Hall
1997-10-20 4:00 ` [Reposted due to Enlow UCE cancel]: " Eric Hildum
1997-10-09 4:00 ` Final kick at the "Merced Guessing Game" Gregg E Economou
1997-10-10 4:00 ` Jan Vorbrueggen
1997-10-08 4:00 ` David Chase [this message]
1997-10-08 4:00 ` William Clodius
[not found] ` <61ho3v$3m0$1@goanna.cs.rmit.edu.au>
1997-10-09 4:00 ` boo
1997-10-09 4:00 ` William Clodius
1997-10-10 4:00 ` Richard A. O'Keefe
1997-10-10 4:00 ` Tyson Richard DOWD
1997-10-12 4:00 ` boo
1997-10-13 4:00 ` Patricia Shanahan
1997-10-15 4:00 ` boo
1997-10-15 4:00 ` Patricia Shanahan
1997-10-13 4:00 ` Steve Tate
1997-10-13 4:00 ` boo
1997-10-13 4:00 ` Aaron Spink
1997-10-14 4:00 ` boo
1997-10-18 4:00 ` [Reposted due to Enlow UCE cancel]: " tgg
1997-10-18 4:00 ` tgg
1997-10-13 4:00 ` Bernd Paysan
1997-10-13 4:00 ` boo
1997-10-13 4:00 ` Victor Yodaiken
1997-10-14 4:00 ` Jason.Ozolins
1997-10-15 4:00 ` boo
1997-10-14 4:00 ` Aaron Spink
1997-10-15 4:00 ` David Chase
1997-10-10 4:00 ` boo
1997-10-11 4:00 ` Paul DeMone
1997-10-11 4:00 ` Toon Moene
1997-10-11 4:00 ` Patricia Shanahan
1997-10-13 4:00 ` Gregg E Economou
1997-10-13 4:00 ` Patricia Shanahan
1997-10-14 4:00 ` Richard A. O'Keefe
1997-10-15 4:00 ` boo
1997-10-16 4:00 ` Timothy A. Seufert
1997-10-16 4:00 ` boo
1997-10-16 4:00 ` Toon Moene
1997-10-17 4:00 ` Richard A. O'Keefe
1997-10-20 4:00 ` [Reposted due to Enlow UCE cancel]: " tgg
1997-10-20 4:00 ` Jason.Ozolins
[not found] ` <EHrwv9.2w3@world.std.com>
1997-10-10 4:00 ` David Gould
1997-10-10 4:00 ` Maynard Handley
1997-10-11 4:00 ` new languages Preston Briggs
1997-10-10 4:00 ` Final kick at the "Merced Guessing Game" David Gould
1997-10-16 4:00 ` Patricia Shanahan
-- strict thread matches above, loose matches on Subject: below --
1997-10-09 4:00 Robert Harley
1997-10-08 4:00 Robert Harley
1997-10-08 4:00 ` Michael Meissner
1997-10-09 4:00 ` Richard A. O'Keefe
1997-10-08 4:00 Robert Harley
[not found] ` <343C0387.41C6@lanl.gov>
1997-10-08 4:00 ` boo
1997-10-09 4:00 ` Patrick Chase
1997-10-10 4:00 ` boo
1997-10-09 4:00 ` David Chase
1997-10-08 4:00 ` boo
1997-10-09 4:00 ` William Clodius
1997-10-09 4:00 ` David Chase
1997-10-07 4:00 Robert Harley
1997-10-07 4:00 ` Martin Rodgers
1997-10-07 4:00 ` Nick Maclaren
1997-10-07 4:00 ` Shankar Unni
1997-10-08 4:00 ` boo
1997-10-09 4:00 ` Patrick F. McGehearty
1997-10-10 4:00 ` Richard A. O'Keefe
1997-10-15 4:00 ` David Chase
1997-10-16 4:00 ` William Clodius
1997-10-03 4:00 Robert Harley
1997-10-06 4:00 ` Richard A. O'Keefe
1997-10-06 4:00 ` boo
1997-10-07 4:00 ` Serge Pachkovsky
1997-10-07 4:00 ` Martin Rodgers
1997-10-07 4:00 ` Greg Weeks
1997-10-07 4:00 ` Martin Rodgers
[not found] ` <343AAE5A.A3FCC9D@no.informatik.spam.tu-muenchen.thanks.de>
1997-10-09 4:00 ` Torben AEgidius Mogensen
[not found] ` <EHsr7B.Dt8@bit3.com>
1997-10-10 4:00 ` Torben AEgidius Mogensen
[not found] ` <61cv5e$qn$6@vixen.cso.uiuc.edu>
1997-10-08 4:00 ` William Clodius
1997-10-07 4:00 ` Carlie Coats
1997-10-07 4:00 ` Paul Hsieh
1997-10-07 4:00 ` boo
1997-10-08 4:00 ` Carlie Coats
1997-10-07 4:00 ` Richard A. O'Keefe
1997-10-06 4:00 ` Graham Hughes
1997-10-07 4:00 ` William Clodius
1997-10-08 4:00 ` Richard A. O'Keefe
1997-10-08 4:00 ` William Clodius
1997-10-08 4:00 ` William Clodius
[not found] ` <y4wwjon203.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>
1997-10-08 4:00 ` William Clodius
1997-10-08 4:00 ` Stanley Chow
1997-10-09 4:00 ` William Clodius
1997-10-10 4:00 ` Larry Kilgallen
1997-10-10 4:00 ` Zalman Stern
1997-10-11 4:00 ` Andrew Cruickshank
1997-10-12 4:00 ` Paul D. DeRocco
1997-10-13 4:00 ` Michael Williams
1997-10-07 4:00 ` boo
1997-10-07 4:00 ` William Clodius
1997-10-08 4:00 ` Gregg E Economou
1997-10-08 4:00 ` Richard A. O'Keefe
1997-10-08 4:00 ` David Chase
1997-10-08 4:00 ` James C. Stutts
1997-10-02 4:00 Robert Harley
1997-10-02 4:00 ` Nick Maclaren
1997-10-03 4:00 ` Richard A. O'Keefe
1997-10-02 4:00 Robert Harley
1997-10-02 4:00 ` Nick Maclaren
1997-10-02 4:00 ` Stanley Chow
1997-09-30 4:00 Paul DeMone
1997-09-30 4:00 ` Guy Harris
1997-10-01 4:00 ` Tom Thornhill
1997-10-01 4:00 ` Richard A. Schumacher
1997-10-01 4:00 ` Tom Thornhill
1997-10-01 4:00 ` Paul DeMone
1997-10-01 4:00 ` Jim Hull
1997-10-01 4:00 ` Nick Maclaren
1997-10-01 4:00 ` J. Corbally
1997-10-01 4:00 ` Nick Maclaren
1997-10-01 4:00 ` Ketil Z Malde
1997-10-01 4:00 ` Michael D. Nahas
1997-10-01 4:00 ` brianh
1997-10-01 4:00 ` Stefan Monnier
1997-10-01 4:00 ` Nick Maclaren
1997-10-01 4:00 ` John Wilson
1997-10-01 4:00 ` P Murray
1997-10-01 4:00 ` Nick Maclaren
1997-10-02 4:00 ` Andrew Glew
1997-10-02 4:00 ` Vesa Karvonen
1997-10-02 4:00 ` Joseph H Allen
1997-10-02 4:00 ` Wilco Dijkstra
1997-10-03 4:00 ` Jason.Ozolins
1997-10-03 4:00 ` Alex Colvin
1997-10-06 4:00 ` Richard A. O'Keefe
1997-10-08 4:00 ` Zalman Stern
1997-10-03 4:00 ` Stefan Monnier
1997-10-03 4:00 ` Stefan Monnier
1997-10-02 4:00 ` Torben AEgidius Mogensen
1997-10-02 4:00 ` Patrick F. McGehearty
1997-10-02 4:00 ` brianh
1997-10-03 4:00 ` Michael Williams
1997-10-01 4:00 ` Allen Kim
1997-10-02 4:00 ` Jon Leech
1997-10-02 4:00 ` Stefan Monnier
1997-10-03 4:00 ` Richard A. O'Keefe
1997-10-03 4:00 ` Mike Smith
1997-10-03 4:00 ` Nick Maclaren
1997-10-03 4:00 ` Rob Barris
1997-10-03 4:00 ` Andrew Glew
1997-10-05 4:00 ` Gianni Mariani
1997-10-04 4:00 ` Nick Maclaren
1997-10-04 4:00 ` H. Eckert
1997-10-05 4:00 ` Andy "Krazy" Glew
1997-10-06 4:00 ` Nick Maclaren
1997-10-02 4:00 ` Eric Hildum
1997-10-01 4:00 ` Paul DeMone
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox