Shopify / ejson

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

Switch from JSON to OJ? #1

Closed eapache closed 10 years ago

eapache commented 10 years ago

https://github.com/ohler55/oj

I started using it for my StarScope gem because it is substantially faster.

burke commented 10 years ago

I thought about that too. Here's what convinced me not to bother:

1) Ejson starts a ruby process, then decrypts/encrypts a single JSON document, typically 2-200 lines long. The JSON part of that works out to less than 1% of the runtime. 2) OJ is another dependency. Thor isn't exactly lightweight, but I still want to be conservative about adding more.

I like the simplicity of using the builtin one more than I like the ~1% perceived performance improvement of using a sane JSON implementation.

eapache commented 10 years ago

Fair. Presumably revisitable if someone starts trying to use this on many-MB json?

burke commented 10 years ago

Yeah, absolutely, though I think if you have multi-megabyte secrets you're doing something wrong.

eapache commented 10 years ago

Probably :)