On 6/26/07, Charles Oliver Nutter <[EMAIL PROTECTED]> wrote:

Van Simmons wrote:
> All:
>
> Is there a way to determine via API that some piece of code has been
> JIT-compiled?  Is there API available in JRuby 1.0 to cause JIT
> compilation to occur?
>
Hmm, an API for this...interesting. I don't see why we couldn't add it I
guess, but there's nothing there now. What would such a thing look like?


I would probably need to go look at the byte compiler code to say anything
reasonable but that never stops me.  Please keep in mind that I'm pretty new
to Ruby and JRuby as well.

I think that for now what would be handy for me would be some way to pass a
module, class, or method name (from Ruby) and ask if it has been byte
compiled in some current context.  In the future, being able to pass a proc
in and try to force byte compilation would also be good.  Not sure if I
understand what I'm saying here, as I haven't looked closely at the code,but
I'm looking at byte compilation as sort of a super-fast form of
memoization.  Does that make sense?

Basically the problem we are running into is that some of our test cases
seem really slow.  We're just looping through and incrementing variables to
try and simulate what we are going to do in some very tight numerical
loops.  The results we're seeing make us pretty sure that we haven't managed
to get hotspot involved but we have no way of knowing that for sure (at
least no way that we are aware of).  We're trying to avoid dropping down to
Java until we have to since we need as much as possible to be portable to
.Net and MRI.

Any of this make sense?

- Charlie


thx

rvs

Reply via email to