Comments (7)
JSBN so far seems to be faster (aside from the fluke Chrome benchmark), it would be fun to try to optimize the BigNumber.js source and see if it could be made competitive in this particular benchmark!
from bignumber.js.
JSBN seems to do worse on Chrome 34?
May be interesting as well to compare big number calculations with regular floating point Number calculations? Like:
var a = 1024;
var b = 9999;
(a + b) * b;
from bignumber.js.
34 beta. Yea it's strange. Out of curiosity I did include the browser float calculations when I was toying with it. It was so uncomparable that I couldn't event see bars of other tests at all. Try it ;)
from bignumber.js.
The source code is already pretty well optimsed across various platforms, and I'm happy with its competitiveness as it is.
bignumber.js can be made faster by adding more specialised code paths (i.e. more code) and by storing values in a different format (e.g. a higher base), but having experimented with such I found the benefits didn't outweigh the costs.
jsbn is great, but it's integers only.
from bignumber.js.
Totally understandable. The code quality is the reason we were looking at this, wouldn't want you to sacrifice that. Thank you for your time!
from bignumber.js.
Would you be able to make an asm.js optimized version? Does anything like that exist?
from bignumber.js.
I am working on a faster version but not optimised for asm.js.
I had the idea of re-writing the whole thing in the asm.js JavaScript subset, and looked into it last year briefly and came to the conclusion that it wasn't viable, and that it wasn't what asm.js was for.
The library could probably be optimised further using typed arrays but I am not looking to go down that route at the moment as I want to keep the broad platform compatibility, and some compilers may be making that optimisation behind the scenes anyway.
from bignumber.js.
Related Issues (20)
- Using version 9.1.1, run new BigNumber(0).exponentiatedBy('-12345678901234567890123456789012345678901234567890').valueOf() Is return to infinity normal? HOT 1
- Issue toNumber() function round up when number is too big (v9.1.1) HOT 2
- Division on exponential values leads to infinite loop HOT 3
- 负数加减乘除不好用 HOT 1
- [Feature Request]: Can we support `toBigInt`?
- Type error HOT 2
- Big Number (toFixed,dp,decimalPlaces,toFormat) - Chrome Update Issue 115.0.5790.102 HOT 24
- Minus sign in formatted strings HOT 2
- wrong calculation result on multipliedBy/times methods HOT 1
- toNumber does not respect ROUNDING_MODE HOT 11
- Calculation error HOT 1
- Is there any other way to handle new BigNumber(999999999999999999999) without using strings? HOT 2
- Difference between multipliedBy and dividedBy behaviors HOT 2
- Different result between toFixed and toNumber HOT 1
- Can't convert to Base64 HOT 1
- Tree shake commonjs version from mjs version HOT 1
- toFixed error
- [Bug] Return Type of Methods HOT 1
- Logarithms (I know there is another issue about this)
- toString() default base is not 10? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bignumber.js.