[GRASS-dev] Call Grass modules from C++ code

Pietro peter.zamb at gmail.com
Fri Mar 15 07:49:12 PDT 2013


Hi Vaclav,

On Fri, Mar 15, 2013 at 2:32 PM, Vaclav Petras <wenzeslaus at gmail.com> wrote:
>> Usually I use Python for everything, but this time I need performance :-)
>
> Hi, thank you for sharing your decisions.
>
> One more thing comes in my mind: Cython [1]. Unfortunately, I have no
> personal experience but some say that it can be much much faster than
> Python. The code translates to some messy C, so it could be fast.
> Obviously, it will not make faster existing Python code and especially
> pygrass.modules but simple functions are probably faster. Not sure if
> someone tried Cython with GRASS.

One problem to use Cython is write all the "header" files to link
cython with the GRASS library, the good news is that I've tried to
generate these files automatically using: cwrap[0] and it seems to
work fine through clang frontend. but I don't have enough time to test
it!
I would like to translate some lower part of the pygrass library to
use cython and see if and how much the speed gain is.

Pietro

[0] https://github.com/geggo/cwrap.git


More information about the grass-dev mailing list