saltyrtc / saltyrtc-client-js

SaltyRTC JavaScript implementation.
MIT License
29 stars 6 forks source link

Crypto Performance Improvements #99

Closed lgrahl closed 6 years ago

lgrahl commented 6 years ago

This PR intends to improve the overall encryption/decryption performance. It also adds a performance test suite.

Results from the new tests so far are very promising. The base (Main Thread (shared key store=false)) is what we used before this PR.

Results are from an AMD Ryzen 7 2700X (higher % is faster).

Encryption Chrome 67.0.3396.99 Firefox 61.0.1
Main Thread (shared key store=false) 100% (base) 100% (base)
Main Thread (shared key store=true) 201% 281%
Web Worker (shared key store=false, transferables=false) 93% 95%
Web Worker (shared key store=false, transferables=true) 96% 97%
Web Worker (shared key store=true, transferables=false) 171% 239%
Web Worker (shared key store=true, transferables=true) 176% 245%
Decryption Chrome 67.0.3396.99 Firefox 61.0.1
Main Thread (shared key store=false) 100% (base) 100% (base)
Main Thread (shared key store=true) 197% 275%
Web Worker (shared key store=false, transferables=false) 91% 93%
Web Worker (shared key store=false, transferables=true) 92% 96%
Web Worker (shared key store=true, transferables=false) 161% 235%
Web Worker (shared key store=true, transferables=true) 174% 254%

To Do:

dbrgn commented 6 years ago

Also, before merging this, could you squash the two cleanup commits "Fix lint errors" and "Cleanup let -> const in keystore.spec.ts" into their preceding commits? They don't add any value as standalone commits :slightly_smiling_face:

dbrgn commented 6 years ago

I fixed the remaining issue. Will merge once tests pass.