Skip to content

Enormous CPU times using large DECIMAL_PLACES with hex numbers #342

@Meemaw

Description

@Meemaw

Seeing some enormous CPU times when using high DECIMAL_PLCAES config with hex numbers. The following code takes ~30s to finish on a high end computer.

Removing the DECIMAL_PLCAES option (or making it smaller), maker things better.

import { BigNumber } from "bignumber.js";

BigNumber.config({
  DECIMAL_PLACES: 1e9
});

BigNumber("0x9a864287d")

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