Use PySequence_Fast for faster *arg unpacking
Much faster than using pyElements into a std::vector<Box*, StlCompatAllocator>. I think pyElements is pretty good, but the PySequence_Fast approach can beat it since we do the entire conversion up-front, and don't pay the dispatching cost per iteration. Plus the STL-compat-allocator is just as expensive as a Python list, and most of the time the extra storage isn't needed anyway.
Showing
Please register or sign in to comment