PhpUnitsOfMeasure / php-units-of-measure

A library for handling physical quantities and the units of measure in which they're represented.
MIT License
305 stars 77 forks source link

Making `static::unitNameOfAliasesAlreadyRegistered` optional depending on environment #75

Open vasily-kartashov opened 6 years ago

vasily-kartashov commented 6 years ago

Can you think of the best way to make the uniqueness test in AbstractPhysicalQuantity::addUnit:24 optional? Profiling says this is by far the slowest part of the library. It's a great feature for development environment, but there's little reason to incur this penalty in production environment, especially with a proper CI set up.

Same applies for HasSIUnitsTrait::addMissingSIPrefixUnits:191.