Shopify / ejson

EJSON is a small library to manage encrypted secrets using asymmetric encryption.
MIT License
1.35k stars 62 forks source link

Parallelize encryption to improve performance #18

Closed burke closed 9 years ago

burke commented 9 years ago

@Shopify/locutus

Turns out encryption is pretty slow.

yak

Time to decrypt test file fetched from https://edg.epa.gov/data.json and encrypted with a random key:

On my macbook:

On production infrastructure (first is Go 1.4, 1 proc, master; second is Go 1.5, 32 procs, optimize branch):

burke@borg3.ash:~ $ ./test_deployed
7.371902681s
burke@borg3.ash:~ $ ./test_go_1.5_optimize_branch
794.795795ms
burke commented 9 years ago

Damn, turns out the profile result I was originally looking at that motivated this was from when we were still invoking ejson as bundle exec ejson. Our ejson files aren't actually big enough that this really pays off; most of the cost was from loading bundler and ruby. This'll only save us like 50-100ms.

csfrancis commented 9 years ago

Oh that's too bad. It's still pretty cool though.

:+1: