Skip to content

[C++][Compute] Improve power kernel #28204

Description

@asfimport

See comments at #9841 (comment)

Power kernel is modified from add/sub/mul/div kernels. But power is much more complicated than basic arithmetic operations. Some limitations in current implementation:

  • Base and exponent must be the same type, this is not reasonable

  • Null handling is delayed to the end, and power is always calculated even for nulls (with whatever base/exponent happen to be in the slots). This is a big waste of time for expensive power calculations.

    For checked power, integer overflow is checked for every multiplication. As the integer upper bound is already know, it can be calculate directly if the power will overflow. It will remove overflow checks in each iteration, but will introduce one expensive logarithm operation. Maybe deserve a try.

Related issues:

Note: This issue was originally created as ARROW-12413. Please see the migration documentation for further details.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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