cryptocoinjs / bs58

Base58 encoding/decoding for Bitcoin
http://cryptocoinjs.com/modules/misc/bs58/
MIT License
216 stars 48 forks source link

Remove bigi dep, optimize byte operations #6

Closed deckar01 closed 10 years ago

deckar01 commented 10 years ago

Replace bigi with pure js. Optimize byte operations with bitwise shifts.

Implements #2.

deckar01 commented 10 years ago

Thanks for being patient with me : )

jprichardson commented 10 years ago

Thanks again. What I love about this is that I can make a lot of positive changes elsewhere in this project. I was hesitant to include this package as a dep in so many other packages because I knew that I would be dragging along bigi. Not anymore!

deckar01 commented 10 years ago

Just for fun I decided to write a benchmark script in node to more accurately capture the performance in node.

With bigi:

load overhead: 4ms
encode:  34,063 ops/sec
decode: 100,719 ops/sec

Without bigi

load overhead: 1ms
encode: 212,121 ops/sec
decode: 218,750 ops/sec
jprichardson commented 10 years ago

Damn, that's quite the performance boost :)