correct performance problems with bindings python