Skip to content

Improve RAI_TensorLength performance #495

Closed
@filipecosta90

Description

@filipecosta90

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions