Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

BCH Buffer Update#209

Merged
matiu merged 3 commits intobitpay:cashfrom
micahriggan:feature/buffer-performance-cash
Feb 14, 2018
Merged

BCH Buffer Update#209
matiu merged 3 commits intobitpay:cashfrom
micahriggan:feature/buffer-performance-cash

Conversation

@micahriggan
Copy link

  • new Buffer() is deprecated
  • new Buffer([]) should be Buffer.from([])
  • new Buffer(9) should be Buffer.alloc(9)
  • BufferWriter should keep track of length as you write
  • Transaction.hash getter should cache the last hash, until you change it.

Before Changes

Benchmarking Script
---------------------------------------
isPublicKeyHashIn x 42,112,577 ops/sec ±2.14% (421 runs sampled)
isPublicKeyOut x 30,459,210 ops/sec ±2.80% (430 runs sampled)
toAddress x 65,897 ops/sec ±3.15% (323 runs sampled)
getAddressInfo x 86,997 ops/sec ±2.68% (325 runs sampled)
Done
----------------------------------------------------------------------
Finished

After Changes

Benchmarking Script
---------------------------------------
isPublicKeyHashIn x 65,906,640 ops/sec ±0.98% (516 runs sampled)
isPublicKeyOut x 51,775,114 ops/sec ±0.92% (510 runs sampled)
toAddress x 122,002 ops/sec ±1.03% (437 runs sampled)
getAddressInfo x 143,790 ops/sec ±0.93% (528 runs sampled)
Done
----------------------------------------------------------------------
Finished

@matiu
Copy link
Contributor

matiu commented Feb 13, 2018

There is a failing test at:
https://travis-ci.org/bitpay/bitcore-lib/builds/340632730#L1213

Could you check it?

@matiu matiu merged commit ec30cdc into bitpay:cash Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants