From: David Fraser <davidf@sj...> - 2003-09-18 12:20:52
I have been wondering whether it might be possible to include pscyo
compilations of functions in a .pyc-style compiled file.
The reason for this would be to decrease application startup time, by
removing the need for the initial compilation.
Is this possible?
On Thu, Sep 18, 2003 at 02:19:36PM +0200, David Fraser wrote:
> I have been wondering whether it might be possible to include pscyo
> compilations of functions in a .pyc-style compiled file.
> The reason for this would be to decrease application startup time, by
> removing the need for the initial compilation.
> Is this possible?
At the moment it is hard to implement. The reason is that memory management of
code buffers is, let's say, inexistent. If you want to deal with releasing
memory, you have to track all references stored as immediate in the machine
code. Saving this code to disk is even more complex because you not only have
to track the reference but fix them when you reload the code. This would mean
adding "linker" functionality.
Another approach that could be taken would be to only save some "hints" that
would guide the next recompilation. This would easily cut the compilation time
in half, and reduce memory requirements too, by avoiding the compilation of
over-specific versions of the code that will have to be recompiled more
generally afterwards anyway.