bignumber.js
bignumber.js copied to clipboard
Enormous CPU times using large DECIMAL_PLACES with hex numbers
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")