Closed
Description
We saw an substantial amount of cpu cycles being spent on this method, that is called for multiple reasons.
we're accessing the dl_tensor structure, and it's shape array and calling the for loop.... just to do the simple computation of multiplying the dimension sizes.
we can have the pre-computed length without always calculating it...
Changes will be validated with a proper microbenchmark...
https://github.com/RedisAI/RedisAI/blob/master/src/tensor.c#L460