astropy/astropy — pull request #2544 by mdboom (2014-05-21 18:29:59+00:00)
Title: Performance improvements for astropy.units

- For compose, the set of destination units are prefiltered to only
include units that have bases in common with "self". This cuts down
on the search space considerably in most cases.

- Inline some delegation functions.

- Replace 2 isinstance calls with 1

- Cache the hash of composite units, which can be expensive to compute.

This is partially in response to #2479, though it probably makes sense to also include #2542 as well (though this and #2542 are completely independent).