When the registry is instantiated, the definition file is parsed, loaded and │ │ │ some pre-calculations are made to speed-up certain common operations. This │ │ │ ├── html2text {} │ │ │ │ @@ -126,18 +126,18 @@ │ │ │ │ ....: │ │ │ │ │ │ │ │ In [17]: a = 1 * ureg.meter │ │ │ │ │ │ │ │ In [18]: b = 1 * ureg.centimeter │ │ │ │ │ │ │ │ In [19]: %timeit f(a, b) │ │ │ │ -147 us +- 36.7 us per loop (mean +- std. dev. of 7 runs, 10,000 loops each) │ │ │ │ +157 us +- 3.36 us per loop (mean +- std. dev. of 7 runs, 10,000 loops each) │ │ │ │ │ │ │ │ In [20]: %timeit g(a, b) │ │ │ │ -22 us +- 2.75 us per loop (mean +- std. dev. of 7 runs, 10,000 loops each) │ │ │ │ +16 us +- 367 ns per loop (mean +- std. dev. of 7 runs, 100,000 loops each) │ │ │ │ ********** SSppeeeedd uupp rreeggiissttrryy iinnssttaannttiiaattiioonn_## ********** │ │ │ │ When the registry is instantiated, the definition file is parsed, loaded and │ │ │ │ some pre-calculations are made to speed-up certain common operations. This │ │ │ │ process can be time consuming for a large definition file such as the default │ │ │ │ one (and very comprehensive) provided with pint. This can have a significant │ │ │ │ impact in command line applications that create and drop registries. │ │ │ │ Since version 0.19, part of this process can be cached resulting in a 5x to 20x