ZipPy status update

Wei Zhang ndrzmansn at gmail.com
Fri Dec 20 16:45:49 PST 2013


Hi Stefan,

> After looking at the code, I am kind of surprised that you are seeing so great performance.
> The first thing, I tried to see is what your `Arguments` objects look like and how you use frames. And I see that you actually rely heavily on materialized frames.[1]
> The only difference I can make out, compared to what I had, is that you materialize conditionally.

Only functions that close over its declaration frame (closures) use
PArguments#declarationFrame. This doesn't happen so often in my
benchmarks.
In most cases, zippy accesses local variable using VirtualFrames,
which is optimized by Truffle/Graal.

> I do wonder, what is the typical granularity of a Python method?
> At least in SOM, methods seem to be rather small. Perhaps a few AST nodes on average.
> Could that make a difference?

Zippy inlines function calls when they become hot. Inlining helps
performance a lot.
I strongly recommend you to apply inlining in TruffleSOM if you haven't yet.

> Another detail I noticed is that you are using another strategy for type handling in the type system. You use a combination of @TypeCheck and @TypeCast, while I use @ImplicitCast.
> What is the difference of these two approaches?

I use @TypeCheck and @TypeCast to customize type checks and
conversions in ZipPy. I just followed the SimpleLanguage examples in
Truffle API.
@ImplicitCast is new to me. I don't know how to use it, since there
isn't any related document or example.

Hope this helps.
Thanks,

/Wei

On Fri, Dec 20, 2013 at 4:09 PM, Stefan Marr <java at stefan-marr.de> wrote:
> Hi Wei:
>
> On 20 Dec 2013, at 22:25, Wei Zhang <ndrzmansn at gmail.com> wrote:
>
>> I attached the performance charts that compare ZipPy to the other
>> major Python 2 or 3 implementations like CPython and PyPy.
>> The best speedup over CPython3.3 so far is over 100x on fannkuchredux.
>> Please refer to the link below for more numbers:
>> http://goo.gl/NeuIrf
>>
>> In general, we are getting fairly close to PyPy with a few benchmarks
>> running even faster.
>
> After looking at the code, I am kind of surprised that you are seeing so great performance.
> The first thing, I tried to see is what your `Arguments` objects look like and how you use frames. And I see that you actually rely heavily on materialized frames.[1]
> The only difference I can make out, compared to what I had, is that you materialize conditionally.
>
> I do wonder, what is the typical granularity of a Python method?
> At least in SOM, methods seem to be rather small. Perhaps a few AST nodes on average.
> Could that make a difference?
>
> Another detail I noticed is that you are using another strategy for type handling in the type system. You use a combination of @TypeCheck and @TypeCast, while I use @ImplicitCast.
> What is the difference of these two approaches?
>
>> Hope you all have a great holiday!
>
> Same to you!
>
> Thanks
> Stefan
>
> [1] https://bitbucket.org/ssllab/zippy/src/43cbb6f6410da598623074dc3ce50414cd762567/graal/edu.uci.python.runtime/src/edu/uci/python/runtime/function/PArguments.java?at=default#cl-37
>
> --
> Stefan Marr
> Software Languages Lab
> Vrije Universiteit Brussel
> Pleinlaan 2 / B-1050 Brussels / Belgium
> http://soft.vub.ac.be/~smarr
> Phone: +32 2 629 2974
> Fax:   +32 2 629 3525
>


More information about the graal-dev mailing list