Calling abs is unnecessary, as the difference is squared immediately afterwards, which always results in a positive number.
Impact?
For simple Copy scalar types, benchmarking showed no consistent performance difference. So the only impact is code reduction / simplification.
Even though we support Clone types the only type in any way supported right now is num-bigint. I tried to benchmark this to see if that showed a performance improvement, but gave up due to dependency version incompatibilities between num-bigint and ndarray-*.
Currently, the module does not work at all with num-complex, so there is no cost in this respect.
What?
Removes a redundant call to
abs
insq_l2_dist
.Why?
Calling
abs
is unnecessary, as the difference is squared immediately afterwards, which always results in a positive number.Impact?
For simple
Copy
scalar types, benchmarking showed no consistent performance difference. So the only impact is code reduction / simplification.Even though we support
Clone
types the only type in any way supported right now isnum-bigint
. I tried to benchmark this to see if that showed a performance improvement, but gave up due to dependency version incompatibilities betweennum-bigint
andndarray-*
.Currently, the module does not work at all with
num-complex
, so there is no cost in this respect.