peterolson / BigInteger.js

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

A try to improve performance of BigInteger.js (small1 * small2 case) #47

Closed Yaffle closed 9 years ago

Yaffle commented 9 years ago

Hello, what do you think about this?

The idea is to avoid ".isSmall" by using a private method - "_multiplyBySmall".

Also, I splitted parseValue into smaller functions, this helps to some js engines, seems. And it will return this for any non-string and non-number value... but avoidance of instanceof also improves perf.

peterolson commented 9 years ago

Hey, thanks for the commit, I'll try to look at it next week. I won't have time until after Tuesday.

суббота, 19 сентября 2015 г. пользователь Viktor написал:

Hello, what do you think about this?

The idea is to avoid ".isSmall" by using a private method - "_multiplyBySmall".

Also, I splitted parseValue into smaller functions, this helps to some js

engines, seems.

You can view, comment on, or merge this pull request online at:

https://github.com/peterolson/BigInteger.js/pull/47 Commit Summary

  • Update BigInteger.js

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/peterolson/BigInteger.js/pull/47.

Yaffle commented 9 years ago

@peterolson OK

peterolson commented 9 years ago

Looks good to me.