comp.lang.ada
 help / color / mirror / Atom feed
From: Roedy Green <roedy@oberon.ark.com>
Subject: Re: Hotspot. Dynamic compilers "better" than static one?
Date: 1998/05/30
Date: 1998-05-30T00:00:00+00:00	[thread overview]
Message-ID: <6kpk0h$qmo$1@supernews.com> (raw)
In-Reply-To: 6kocc1$d80@drn.newsguy.com


nabbasi asked, wrote, or quoted:
>I just do not see how this example makes dynamic compiler somehow better
>than
>static compilers. may be someone can comes up with a better example.

Here are a couple of examples where information gleaned from dynamic
analysis could help substantially in optimisation.

(1) Most machine architectures run fastest if there are no jumps, and if
any conditional jumps don't jump, just fall through.

By dynamic analysis you can determine which branch is the more likely, and
put that one inline and branch off to code elsewhere for the less likely
one.

Over a decade ago I spent months writing screaming fast code for the
nucleus of a 32-bit Forth compiler that hand optimised every jump this way.
The secondary advantage is that the most commonly used code is more likely
to be pre-fetched or in cache.  A static optimiser can't do this, since it
has no knowledge of which branch is the more likely.

(2) If through dynamic analysis, the compiler discovered a loop is chewing
up many cycles, it can consider unravelling it, inlining routines in it, or
partially unravelling it.  It would be counter productive to do this to a
non-crucial loop.  You would add to the code bulk and thus slow the whole
process down with longer load times, wasted cache, and wasted RAM.



For the JAVA GLOSSARY and the CMP Utilities: <http://oberon.ark.com/~roedy>
--
Roedy Green                          Canadian Mind Products 

Sponsored by: www.athena.com, makers of Integer, a multiuser
spreadsheet JavaBean. Opinions expressed are  not necessarily 
those of Athena Design.
-30-




  reply	other threads:[~1998-05-30  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6knj4m$odp$1@nnrp1.dejanews.com>
1998-05-30  0:00 ` Hotspot. Dynamic compilers "better" than static one? nabbasi
1998-05-30  0:00   ` Roedy Green [this message]
1998-05-30  0:00     ` Andi Kleen
     [not found]       ` <dewar.896629645@merv>
1998-06-02  0:00         ` Dr Richard A. O'Keefe
1998-06-02  0:00           ` Lieven Marchand
1998-06-01  0:00     ` Norman H. Cohen
1998-06-03  0:00       ` John Volan
1998-06-05  0:00         ` Norman H. Cohen
1998-06-08  0:00           ` John Volan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox