Coder Social home page Coder Social logo

Performance Benchmarks about bignumber.js HOT 7 CLOSED

kyledrake avatar kyledrake commented on July 20, 2024
Performance Benchmarks

from bignumber.js.

Comments (7)

kyledrake avatar kyledrake commented on July 20, 2024

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.

josdejong avatar josdejong commented on July 20, 2024

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.

weilu avatar weilu commented on July 20, 2024

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.

MikeMcl avatar MikeMcl commented on July 20, 2024

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.

kyledrake avatar kyledrake commented on July 20, 2024

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.

 avatar commented on July 20, 2024

Would you be able to make an asm.js optimized version? Does anything like that exist?

from bignumber.js.

MikeMcl avatar MikeMcl commented on July 20, 2024

@werian

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.