caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] FP's and HyperThreading Processors
@ 2003-06-13  6:44 David McClain
  2003-06-13  8:06 ` John Max Skaller
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: David McClain @ 2003-06-13  6:44 UTC (permalink / raw)
  To: caml-list

Hi,

I have a massive application that performs nonlinear fitting to 170+
parameters; a phase retrieval problem for discerning the aberrations of an
optical system. This program is written largely in compiled OCaml closures,
along with a multithreaded vendor supplied FFT routine (presumably optimized
for their processor).

On an old P2 single processor machine at 350 MHz, I am seeing almost 95%+
CPU utilization. But on a new 3 GHz P4 with HyperThreading enabled (dual
register banks for fast context switching and minimum cache coherence
overhead), this same program provides much less than 5% CPU utilization. The
net result is that this program runs only twice as fast on the new 3 GHz P4
as it runs on the old 350 MHz P2.

I suspect, but have yet to prove, that the low utilization is due to a low
CPU to memory bandwidth and to the failure of the L1 and L2 caches to supply
needed operations and data to the CPU. This, I would hypothesize, is going
to be demonstrated by any language that prefers fresh memory allocation for
results, e.g., OCaml, ML, Lisp, Smalltalk, etc.

If I am correct, then it implies that our hardware friends are moving
rapidly in the opposite direction to our advanced software systems. I
mention this in order to tickle the imaginations of both camps.

Cheers,

- David McClain, Sr. Scientist, Raytheon, Tucson, AZ


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 20+ messages in thread
* RE: [Caml-list] Type safe affectation ?
@ 2003-06-17  0:59 Gregory Morrisett
  2003-06-17 11:10 ` Christophe Raffalli
  0 siblings, 1 reply; 20+ messages in thread
From: Gregory Morrisett @ 2003-06-17  0:59 UTC (permalink / raw)
  To: Jacques Garrigue, brian.hurt; +Cc: caml-list

>The problem is that holes at the type level are a difficult feature to
>offer: they require linear types in the compiler. As an 
>optimization, it is a rather high-level one, and maybe not so 
>easy to know when it will apply.

Perhaps, but it's easy for a compiler to offer support
for "tail-allocation" (i.e., a tail-call except for a
constructor application) which is what you need for
a tail-recursive append or map.  Perry Cheng implemented it in
the TIL compiler in about a week if memory serves and
it was a tremendous improvement in performance without
any magic.  

Yasuhiko Minamide wrote a paper on how to model this
well (I think it appeared in ICFP).  The approach used
in our Typed Assembly Language paper is yet another
approach based on a simple subtyping trick with initialization
flags.  It didn't require linear types at all and 
instead of implicit subtyping, you could accomplish
the same thing with an explicit (type-safe) up-cast.

So, all in all, it's quite possible to have the compiler
implement this optimization for the common case of
tail-allocation, and if you think it's more generally
applicable, then you could move to something like TAL's
initialization flags (though I would prefer the former
option.)  

-Greg

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 20+ messages in thread
* RE: [Caml-list] Type safe affectation ?
@ 2003-06-17 14:07 Gregory Morrisett
  0 siblings, 0 replies; 20+ messages in thread
From: Gregory Morrisett @ 2003-06-17 14:07 UTC (permalink / raw)
  To: Christophe Raffalli; +Cc: Jacques Garrigue, brian.hurt, caml-list

> > Perhaps, but it's easy for a compiler to offer support
> > for "tail-allocation"  

> Does this also solve the construction of structure with loop ? (the 
> other case were affectation is needed ? 

No, not really.  The TAL approach would handle this.  
But then so would using an option ref.  I'd hate to
see the external language changed with that kind of
ugliness.

-Greg

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2003-07-02 10:26 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-13  6:44 [Caml-list] FP's and HyperThreading Processors David McClain
2003-06-13  8:06 ` John Max Skaller
2003-06-13 10:03   ` [Caml-list] Type safe affectation ? Christophe Raffalli
2003-06-14 13:35     ` Xavier Leroy
2003-06-15 18:53       ` brogoff
2003-06-15 19:49         ` Brian Hurt
2003-06-16  1:38           ` Jacques Garrigue
2003-06-13 18:38 ` [Caml-list] FP's and HyperThreading Processors Kip Macy
2003-06-13 21:23   ` David McClain
2003-06-13 21:39     ` Kip Macy
2003-06-13 21:56       ` David McClain
2003-06-14 22:08         ` John Max Skaller
2003-06-14  6:11     ` Ville-Pertti Keinonen
2003-06-13 19:07 ` Xavier Leroy
2003-06-13 21:33   ` Jim Farrand
2003-06-13 21:39     ` David McClain
2003-07-02 10:26   ` David Monniaux
2003-06-17  0:59 [Caml-list] Type safe affectation ? Gregory Morrisett
2003-06-17 11:10 ` Christophe Raffalli
2003-06-17 14:07 Gregory Morrisett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).