imp
imp copied to clipboard
Speed up release build
Release builds still include a lot of USAGE
checks in performance-critical parts of the code that make the builds substantially slower than fast builds (with no checks at all). Many of these should be removed entirely, replaced with one-time (rather than every time through a loop) checks, demoted to INTERNAL
checks (only in debug builds), or perhaps only used in the Python interface. The idea is that a release build should be only 1-3% slower than a fast build.
0ae384d provides a templated method to get elements from an an IMP::Array
(e.g. accessing the two indexes in a ParticleIndexPair
). This moves the bounds check from runtime to compile time. This check is called a lot in a typical run as it is triggered at each restraint evaluation.