Share

Psyco, the Python Specializing Compiler

Tracker: Feature Requests

5 Filter entire packages - ID: 2232205
Last Update: Comment added ( heeris )

It would good if I could stop Psyco from trying to optimise any function
under a particular packages (in my case, Cheetah). Since the filter
function only looks at code objects, which have no context information,
this seems to be presently impossible. Alternatively, it would be good if
there was an option to stop the optimisation of functions only called by
other functions which have been passed to 'cannotcompile.'


Jason Heeris ( heeris ) - 2008-11-07 02:26

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 3 )




Date: 2008-11-09 23:11
Sender: heeris

Ah, I didn't realise that Psyco would stop at functions marked with
'cannotcompile()' — there's a note in the docs (3.1):

"Note that this does not prevent functions called by object to be
compiled, if they are bound or proxied or if the profiler chooses to
compile them."

The problem is that Psyco seems to have problems with the Cheetah
templating engine (which compiles html templates into python scripts), but
I don't really have the time to get to the bottom of it (I doubt it would
be a trivial task). It might be worth doing as you say and finding entry
points to mark.


Date: 2008-11-07 12:15
Sender: arigoProject Admin

I will not fix this (Psyco is only in "maintenance" mode nowadays), but I
can suggest a few ideas to do it: a quick hack would be to look at the code
object's co_filename in the filter function.

Alternatively, you can try not using psyco.full() or psyco.profile() at
all, but only psyco.bind() and psyco.cannotcompile(). If you bind() an
entry point function, it should recursively optimize all the functions that
this entry point calls, stopping at functions marked cannotcompile(). You
may have to pass a larger value to the 'rec' argument, if the default is
not enough (the default is to stop recursing after 10 levels).


Date: 2008-11-07 12:14
Sender: arigoProject Admin

I will not fix this (Psyco is only in "maintenance" mode nowadays), but I
can suggest a few ideas to do it: a quick hack would be to look at the code
object's co_filename in the filter function.

Alternatively, you can try not using psyco.full() or psyco.profile() at
all, but only psyco.bind() and psyco.cannotcompile(). If you bind() an
entry point function, it should recursively optimize all the functions that
this entry point calls, stopping at functions marked cannotcompile(). You
may have to pass a larger value to the 'rec' argument, if the default is
not enough (the default is to stop recursing after 10 levels).


Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.