[IronPython] Patched, profiling IronPython executable?

Dino Viehland dinov at microsoft.com
Fri Aug 15 18:43:38 CEST 2008


FastCallable's certainly the right spot if anything will come close.  My main concern is that it'll probably leave a lot of stuff out...

In 2.0 this is actually easier.  You could modify the DLR in MetaAction.cs to wrap every single dynamic operation - whether that be addition, calling something, getting a member, etc...  There's a method called GetMetaObjectRule and it has:

            Expression body = rewriter.VisitNode(AddReturn(binding.Expression, retType));

You could modify this to be something like:

        Expression tmp = Expression.Variable(body.Type);
        body = Expression.Scope(
                        Expression.Call(
                                Expression.Comma(
                                        Expression.Call(typeof(MyType).GetMethod("Enter")),     // MyType is some public type somewhere...
                                        Expression.Assign(tmp, body),
                                        Expression.Call(typeof(MyType).GetMethod("Exit")),
                                        tmp
                                )
                        ),
                        tmp
                )
        );

And you'd get information on every call - warning, this code was compiled with Outlook.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Orestis Markou
Sent: Friday, August 15, 2008 2:25 AM
To: users at lists.ironpython.com
Subject: [IronPython] Patched, profiling IronPython executable?

Hi,

following all the discussion about profiling etc, I was poking around in
IP1.1.2 source code, trying to find out if there is a 'bottleneck' of
sorts, that all function calls are threaded through. My thinking was
that it would be then possible to surround this with profiling
information, logging time taken etc. and compile a profiling ipy.exe.

 From my venture, I think that ICallable is what I should be looking
for. I see that it has many implementors, but I guess FastCallable (in
all its generated glory) should capture a lot of the cases, right?

Am I even on the right track here?

Orestis Markou
_______________________________________________
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