Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Async Crypto Endeavour (+benchmarks!) #19

Merged
merged 17 commits into from
Nov 3, 2016
Merged

Async Crypto Endeavour (+benchmarks!) #19

merged 17 commits into from
Nov 3, 2016

Conversation

dignifiedquire
Copy link
Member

@dignifiedquire dignifiedquire commented Sep 13, 2016

Removes all external crypto libraries, except for those used in libp2p-crypto and multihashing. This means it drops the usage of node-forge and relies only on webcrypto in the browser.

Needs libp2p/js-libp2p-crypto#10

Stats

Size

non-minified minified
before 1.8M 999K
after 606K 382K

Performance

Node.js 6.6.0 Browser (Chrome)
before createKey x 0.40 ops/sec createKey x 0.31 ops/sec
send x 0.15 ops/sec send x 0.11 ops/sec
after createKey x 8.66 ops/sec createKey x 1.64 ops/sec
send x 3.61 ops/sec send x 0.55 ops/sec

@dignifiedquire
Copy link
Member Author

There seems to be an issue with go interop on the verification step currently. Investigating currently.

@dignifiedquire
Copy link
Member Author

There seems to be an issue with go interop on the verification step currently. Investigating currently.

All good, go interop restored in the latest version.

const suite = new Benchmark.Suite('secio')
const ids = []

suite.add('createKey', function (d) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is d?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the other PR or https://benchmarkjs.com/docs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, can it have a better and intuitive name?

Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just missing the Sauce Labs badge

cb(null, Buffer.concat([
data,
digest
]))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be one line, it is just a Buffer.concat

@daviddias daviddias changed the title feat: add benchmarks and integrate with new libp2p-crypto Async Crypto Endeavour (+benchmarks!) Oct 30, 2016
@dignifiedquire
Copy link
Member Author

@diasdavid should be ready

@daviddias daviddias merged commit a1167c0 into master Nov 3, 2016
@daviddias daviddias deleted the bench branch November 3, 2016 09:23
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.

4 participants