[C++-sig] boosst.python: Unregistering builtins

serge Guelton serge.guelton at quiet-oceans.com
Fri Jul 5 09:57:30 CEST 2013


Hi there,

I have a small Python function that takes many arguments, perform a few
computations then returns. It is called a lot of time and almost all my
computations are spent there. Turing it into a C++ function wrapped with
boost.python make the whole program run much faster, and a profiling
pass informs me that all my time is spent in
`rvalue_from_python_stage1'.

Digging through the code, it appears that unregistering some intrinsics
would make the whole stuff run faster, as the linear search for the
right converter would be (hopefully) faster. From what I understand of
`registry.cpp` there is no way to undo, control or prevent the registrations made by `initialize_builtin_converters()`.

Any tip & trick?

cheers


More information about the Cplusplus-sig mailing list