peterolson / BigInteger.js

An arbitrary length integer library for Javascript
The Unlicense
1.12k stars 187 forks source link

Bundle size #186

Open osdiab opened 5 years ago

osdiab commented 5 years ago

Was wondering why the bundle size of this as reported by Bundlephobia appears to be considerably (3x) larger than, say, big.js, which handles arbitrary precision arithmetic:

It's not a huge deal given the relatively small page weight of this already, though having not dug into it yet I wonder if maintainers have some initial thoughts. Thanks!

peterolson commented 5 years ago

My guess is that this is due to some features this library has that other libraries might not have, such as bitwise functions, base conversion, and automatic fallback to the native BigInteger in newer JavaScript runtimes.

osdiab commented 5 years ago

Hmm guess it would potentially be nice then to support things like ES6 modules to allow to opt-in to different functionalities. Unless someone gets to it first, sometime I'll see if I could make a PR that allows for that.