Open
Description
Crypto operations are really slow with gopherjs.
Here is a small benchmark, consisting of hashing a 10MB buffer through SHA-256: http://www.gopherjs.org/playground/#/X98vxh8Y97
- native go: about 120ms
- gopherjs: about 1400ms under Chrome, 1900ms under Firefox
Depending on the type of operation, the difference can be even bigger. Issue #526 mentions 300x slower operations for RSA signatures.
I think it would be really great if crypto operations were implemented by calling the WebCryptoAPI.
As an exemple, here is a simple POC, with the same operation implemented with WebCrypto: http://www.gopherjs.org/playground/#/-_Ed7QocdZ
The execution times are:
- Chrome (you have to load it over HTTPS): about 50ms
- Firefox: about 70ms
That's about 25x as fast as the current version, and even twice as fast as a native go program!
Metadata
Metadata
Assignees
Labels
No labels