[kaffe] Optimization?

Jukka Santala jsantala at tml.hut.fi
Wed May 29 01:14:02 PDT 2002


On Tue, 28 May 2002, Dalibor Topic wrote:
> Wouldn't it be nicer if the VM did that kind of
> optimization automatically? Imagine the following: a

Yes, I had a thought of that, too, especially since Kaffe already has the
feedback-framework (Which doesn't appear to work currently;) in place.
Unfortunately, it'll likely be quite a while until these kinds of
optimizaations make it to the Kaffe VM, so inlining the top few critical
codepaths seems like a decent solution in the meanwhile.

Altough these kinds of optimizations are, IMHO, ones which best suit or
are easiest to implement in presetn Kaffe core. Real, code-transforming
optimizations are quite much harder in the present direct translation, but
inlining is often easier. It should even be possible to inline some of the
lighter C library calls, to reduce the overhead for simple, often-used
calls.

> For even better impact, you could delay inlining of
> code until the jit tries to compile it.

That seems like the way to go; altough the present feedback-feature tries
to compile used classes at start-up anyway. In any case some sort of
feedback loop seems preferable; see my earlier comment about knowledge of
program internals and experience. Without knowing which code-paths are
going to get heavy use, the VM couldn't (shouldn't?) decide on what paths
to inline without just causing extra memory-use. Ofcourse, hopefully
eventually Kaffe would anyway support selective JIT:ing to implement
HotSpot type functionality.

 -Jukka Santala





More information about the kaffe mailing list