[IronPython] IronJs optimizations. Can this be done in IronPython?

Dino Viehland dinov at microsoft.com
Wed Feb 24 23:20:39 CET 2010


We've spent a little bit of time looking at generating optimized code (with guards + inlined operations) but it hasn't yet yielded any benefits over our current polymorphic inlining caching strategy.  But that's probably just because we haven't pushed on it hard enough.

I've also looked at specializing loops over range/xrange as well - that yielded a huge (8x if I recall correctly) benefit in simple for loop performance.  That's probably comparable to the benefit IronJS say between the old/new versions in your link.  But w/o specializing the code in the loop body it didn't seem to be worth the extra complication yet.  I plan to resurrect that work at some point.

Static analysis might be interesting but I have my doubts of how well it'll work for Python.  I think the best direction to go is the runtime type feedback route + guards instead.  The problem here is that it's so easy to invalidate the static analysis that we'll need guards anyway.

As far as V8 levels I'm not sure - Python sure does seem to be a lot more dynamic than JavaScript is but we certainly do want to continue to push on performance.  I wouldn't want to commit to any specific goal yet :)

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luis M. Gonzalez
Sent: Wednesday, February 24, 2010 1:51 PM
To: Discussion of IronPython
Subject: [IronPython] IronJs optimizations. Can this be done in IronPython?

Hi there,

I've been reading a fascinating blog post about IronJs, a new javascript implementation based on the DLR, and I'm excited to read that two optimization features of this implementation have resulted in speed ups comparable to those of Chrome's V8 and Firefox's Tracemonkey.

This is the link:
http://ugh.cc/ironjs-preview-benchmarks-of-the-new-compiler/

These features are:

  *   Static analysis of variables to determine as many types as possible at compile-time
  *   Per-function type-specializing runtime compilation

The author warns that "this is a very very early and limited benchmark. This just test a small part of the runtime.", however, this looks promising since the language is being implemented on top of the DLR.
I wonder if these techniques can be implemented in Ironpython, or if anything along these lines is already being implemented.
Is there any chance to speedup Ironpython to V8's levels?

Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100224/9f219635/attachment.html>


More information about the Ironpython-users mailing list