On Tuesday 22 April 2008 11:35:07 Antonio Cuni wrote:
> Jon Harrop wrote:
> >> Actually, since I was in Redmond last January for three days talking
> >> personally to those guys at Lang.NET, I feel safe to say they have
> >> shelved the JIT for several years, and their optimizations have not
> >> kept pace with those in the JVM.  (See my blog entry previously
> >> mentioned.)
> >
> > My benchmark results disproved your belief.
>
> for what it's worth, in PyPy we discovered that hotspot produces much
> better code than the CLR when the bytecode doesn't follow the standard
> pattern produced by the java/c# compilers.

You generated code that turned out to be less efficient on the CLR in this 
particular case but you cannot validly generalize that to all "non-standard 
code".

Indeed, we know that is wrong because tail calls have the exact opposite 
performance characteristics because you have to work around their complete 
absence (not just inefficiency) on the JVM.

> In particular, we heavily use exceptions to model control flow in our
> RPython program (e.g., every "for" loop needs to catch StopIteration),
> but the CLR JIT it not able to optimize such a case, and thus the first
> versions of the CLI backend produced very slow code; to have
> reasonable performances, we rely on our own inliner/malloc
> removal/exception inliner, which gave a speedup of something like 30x,
> IIRC.

Why didn't you use tail calls instead?

> On the other hand, hotspot produces much better code[1], and moreover we
> get faster code if we *disable* our own optimizations, since if we use
> them it results in more code to analyze because of the inlining.
>
> [1] http://blogs.sun.com/jrose/entry/longjumps_considered_inexpensive

Sure but it looks as though you are unnecessarily applying a workaround for 
the absence of tail calls on the JVM to the CLR when you could have just used 
tail calls on the CLR. Moreover, they are easier to use and much faster than 
anything equivalent on the JVM.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to