Skip to content

Performance issue in BigDecimalMath.pow() #65

@ekuleshov

Description

@ekuleshov

The BigDecimalMath.pow() method is relying on Exception handling to recover from some corner cases.
In my profiling the BigDecimal.longValueExcact() can throw ArithmeticException("Rounding necessary") which takes a large chunk of the BigDecimalMath.pow() execution time. The time is X axis on the flame graph below - roughly 50%?

image

The issue seem to be with try/catch code below and I wonder if the exception could be mitigated with some conditions inside try/catch to avoid some common cases of the ArithmeticException?

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions