[C++-sig] Py++ and caching

Roman Yakovenko roman.yakovenko at gmail.com
Tue Sep 26 20:21:23 CEST 2006


On 9/26/06, Kirill Lapshin <kir at lapshin.net> wrote:
> Hi Roman,
>
> Is there a way to not regenerate source code if cache is valid?

The short answer is - no.
Before we proceed I would like to know the time you will save, can you post it?
Actually few other metrics like size of the project, size of gccxml
generated file
b will be good.

> I.e.
> currently cache saves us from running gccxml, but the whole code
> generation phase is still carried out even though it does not really
> changes anything (unless there was a change in driver .py script).
> Ideally I think what has to be done is: add an option to Py++ that will
> say these files are also a dependency (in addition to header(s) we are
> parsing with gccxml and the whole tree of headers #included from there);
> Py++ will run gccxml as before, only when needed, and will run code
> generation only if gccxml has been run or any additional dependencies
> have been modified since last time. We'll list driver script as
> additional dependency.
>
> This will reduce runtime of Py++ to almost zero if no changes are needed.
>
> I think I should be able to do something similar externally by tracking
> additional dependencies myself and asking cache prior to instantiating
> module builder. However I would imagine others may benefit from such
> functionality as well. Unless it already exists that is. :)

This is not a new idea. It has been raised few times on pygccxml development
mailing list. I don't actually understand how it should work and more over in
my opinion this functionality should be implemented outside of the code
generation script. Like make utility, you describe the dependencies and
it decide what actions should be run.

I understand that it is not possible to implement such functionality without
some help from Py++. I think you need a function that will check whether
header files are different from those Py++ has in cache.

Py++ has goodies package. This package contains few utilities\convenience
function that were contributed by other users.  Can you create an
initial version
of the script and define missing functionality, than we will work
together to improve it and to add it to the goodies package?

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list