imp
imp copied to clipboard
Speed up SWIG wrappers by pruning dependencies
Each module's Python wrapper imports (via SWIG's %import
directive) any module dependencies. This is done so that any classes in the module that derive from those in other modules get the right class hierarchy and can be passed around correctly. Often, however, this is not necessary since the module does not derive any classes from other modules' classes, e.g. IMP.test
or IMP.foxs
. The size of the wrappers for these modules could be significantly decreased (with a corresponding decrease in compile time) by pruning the %import
s to only those modules that contain superclasses. This will be a bit tricky to determine, however.
In the simple case where the module wraps no .cpp
code (e.g. IMP.foxs
) it should be OK to omit all of the %import
s (except perhaps those used by the version info code, e.g. IMP.base
).