Trace trees

12 views
Skip to first unread message

mikong

unread,
May 30, 2008, 4:03:12 AM5/30/08
to rubinius-dev
I'm just posting this in case anyone finds this useful.

Here's the abstract for the paper on trace trees entitled "One Method
at a Time is Quite a Waste of Time":

Most just-in-time compilers for object-oriented languages operate at
the granularity of methods. Unfortunately, even “hot” methods often
contain “cold”
code paths. As a consequence, just-in-time compilers waste time
compiling code
that will be executed only rarely, if at all. We discuss an
alternative approach in
which only truly “hot” code is ever compiled.

This is the link to the article:

http://www.ics.uci.edu/%7Efranz/Site/pubs-pdf/C44Prepub.pdf

Just a disclaimer, I am not knowledgeable about trace trees, VMs,
compilers, etc. I only read Steve Yegge's post on dynamic languages,
and read a couple of papers linked from that article about type
inference and trace trees.

It would have been nice if I have forked Rubinius and implemented a
code to demo trace trees but I'm not really at that level yet. Right
now, I'm just at the stage of looking for a good book on compilers so
that I can contribute to Rubinius in the future.

William Morgan

unread,
May 30, 2008, 9:20:41 AM5/30/08
to rubini...@googlegroups.com
Excerpts from mikong's mail of 30 May 2008 (UTC):

> Here's the abstract for the paper on trace trees entitled "One Method
> at a Time is Quite a Waste of Time":

I posted an Andreas Gal paper a few weeks ago that you might want to
check out too. They're both about the same idea (basically optimize at
the loop level instead of at the method level) but I think that one had
more technical content. (I also started looking into this stuff thanks
to the Steve Yegge post.)

> Right now, I'm just at the stage of looking for a good book on
> compilers so that I can contribute to Rubinius in the future.

The "dragon book" is the go-to compilers book, but you'll have to keep
in mind the dynamically-typed, late-bound, anything-can-be-redefined
nature of Ruby, especially when it talks about optimization.

--
William <wmo...@masanjin.net>

mikong

unread,
May 30, 2008, 10:10:21 AM5/30/08
to rubinius-dev


On May 30, 9:20 pm, William Morgan <wmor...@masanjin.net> wrote:

> I posted an Andreas Gal paper a few weeks ago that you might want to
> check out too. They're both about the same idea (basically optimize at
> the loop level instead of at the method level) but I think that one had
> more technical content. (I also started looking into this stuff thanks
> to the Steve Yegge post.)

Found your post and downloaded the paper. Thanks

> The "dragon book" is the go-to compilers book, but you'll have to keep
> in mind the dynamically-typed, late-bound, anything-can-be-redefined
> nature of Ruby, especially when it talks about optimization.

I got curious about the 'dragon book' when I read about it a week ago.
A question though, is it important that I get the purple dragon book
(which I find a bit expensive)? I wonder, when one mentions 'the
dragon book' do they mean the 2nd edition or any of them?

William Morgan

unread,
May 30, 2008, 11:16:13 AM5/30/08
to rubinius-dev
Reformatted excerpts from michaelgalero's message of 2008-05-30:

> I got curious about the 'dragon book' when I read about it a week ago.
> A question though, is it important that I get the purple dragon book
> (which I find a bit expensive)? I wonder, when one mentions 'the
> dragon book' do they mean the 2nd edition or any of them?

I have no idea what the differences are between editions. My personal
experience is that I owned some version of it in college, sold it
immediately afterwards, and now wish I had kept it.
--
William <wmo...@masanjin.net>

Samuel Tesla

unread,
May 30, 2008, 11:49:27 AM5/30/08
to rubini...@googlegroups.com
I own both the 2nd edition (the red dragon) and the 3rd edition (the
purple dragon). They're both very good, but I would strongly recommend
picking up the 3rd edition (which is probably what you're going to
find in stores anyway). It's been updated for a lot of more modern
stuff. It actually has content that is relevant to dynamic interpreted
languages such as Ruby.

-- Samuel

mikong

unread,
May 30, 2008, 2:13:55 PM5/30/08
to rubinius-dev
On May 30, 11:49 pm, "Samuel Tesla" <samuel.te...@gmail.com> wrote:

> They're both very good, but I would strongly recommend
> picking up the 3rd edition (which is probably what you're going to
> find in stores anyway). It's been updated for a lot of more modern
> stuff. It actually has content that is relevant to dynamic interpreted
> languages such as Ruby.

OK, thanks.

Werner Schuster (murphee)

unread,
May 30, 2008, 2:28:38 PM5/30/08
to rubini...@googlegroups.com
mikong wrote:
> I got curious about the 'dragon book' when I read about it a week ago.
Depends on what you want to do in Rubinius, I'm not quite sure if the
dragon book is what you want - a lot of it is about parsing/lexing
technology. (Mind you, I don't know the latest edition).


For dynamic optimization technology, I'd say you're better off reading
research papers which are available for free online.
Eg. a good starting point is the 'Publications' page of the JikesRVM
project (a JVM + JIT written in Java):
http://jikesrvm.org/Publications

For Garbage Collection, there's really only one book:
http://www.cs.kent.ac.uk/people/staff/rej/gc.html
Again - like the Dragon book - the price is a bit steep, and you might
get a lot of the info from the linked papers in the bibliography:
http://www.cs.kent.ac.uk/people/staff/rej/gcbib/gcbib.html

Reply all
Reply to author
Forward
0 new messages