Yes, it's slower than raw Python. Here's why that's okay.
Adding meters to seconds? Physities throws an error immediately instead of giving you garbage.
No more manual "* 1000" or "/ 3600". Convert between km/h and m/s automatically.
Meter(100) is clearer than 100.0. Your code explains itself.
In 1999, NASA's Mars Climate Orbiter crashed because one team used metric units and another used imperial. The software silently did the wrong math.
| Scenario | Recommendation | Why |
|---|---|---|
| Scientific calculations | โ Physities | Correctness matters more than microseconds |
| Data pipelines | โ Physities | I/O dominates; unit bugs are costly |
| Physics simulations | โ UnitArray (batch) | Vectorized ops are nearly as fast as NumPy |
| Real-time graphics | โ ๏ธ Raw Python/NumPy | Every microsecond counts at 60fps |
| Tight inner loops (10M+ ops) | โ ๏ธ Raw Python/NumPy | Overhead adds up at extreme scale |
For many values, use UnitArray for near-NumPy performance:
Updated on each commit. Raw data ยท Full documentation