[IronPython] Yield Prolog Benchmarks

Dino Viehland dinov at microsoft.com
Tue Oct 7 04:04:54 CEST 2008


I took a look and we're spending most of our time doing old instance/old class accesses.  If they used new-style classes it would probably run faster - although CPython might as well :)  It seems like a good chunk of that is coming from __eq__/__cmp__ on the old-style classes - and w/ new-style classes we can make that really fast.

There's definitely some fat that can be trimmed here though - we currently have an extra layer of indirection when looking up the class vars which is just legacy of the DLR changing under us in interesting ways.  We could also look at specifically tuning old class dictionaries - currently we only have a special dict for old instances dictionaries.  But I suspect we'll look at tuning new-style classes more first.

One possible thing which could be hitting Mono would be the use of our Dictionary<SymbolId, object>.  That relies on having IEquatable<SymbolId> working well.  But maybe not, I just say that because we hit those dictionaries a lot.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Seo Sanghyeon
Sent: Sunday, October 05, 2008 12:21 AM
To: Discussion of IronPython
Subject: [IronPython] Yield Prolog Benchmarks

Yield Prolog is an embeddable Prolog implementation that compiles to
Python, C#, or JavaScript using "yield" statements in those languages.
http://yieldprolog.sourceforge.net/

It comes with a nice benchmark calculating 2680 solutions of 11-queens
problem in Prolog. So I tried it out of curiosity.
http://yieldprolog.sourceforge.net/benchmarks.html

How to run:
svn co https://yieldprolog.svn.sourceforge.net/svnroot/yieldprolog/YieldProlog
yieldprolog
cd yieldprolog/source/python
# Edit Compiler.py to comment out "from compiler import *". It is not needed.
cd examples/Benchmarks
python queens.py

Intel Core 2 T7200 2.00GHz 2.00GB RAM
Microsoft Windows XP Home Edition SP2

Python 2.5.1
36.2195480152 36.3135356589 36.0008464763

IronPython 2.0 Beta 5 on .NET Framework 3.5 SP1
52.5789892291 53.0868051666 53.0352047537

In this particular benchmark, IronPython 2 comes about 30% slower than
Python 2.5. Mono is much, much slower than .NET for this particular
benchmark, by the way. I am investigating.

--
Seo Sanghyeon
_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list