bignumber.js icon indicating copy to clipboard operation
bignumber.js copied to clipboard

Enormous CPU times using large DECIMAL_PLACES with hex numbers

Open Meemaw opened this issue 2 years ago • 0 comments

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")

Meemaw avatar Mar 25 '23 19:03 Meemaw