Closed cconstab closed 3 weeks ago
For comparison same code running on Windows..
JIT
String length: 5120 KB
-----------------------------------------------
Start software AESCTR
..........
2490 ms
161 mbps
software end
-----------------------------------------------
Start Better AES CTR
..........
1268 ms
331 mbps
Better end
Better faster by: 96%
-----------------------------------------------
Start BoringSSL AES CTR
..........
1403 ms
299 mbps
BoringSSL end
BoringSSL faster by: 77%
-----------------------------------------------
and AOT
-----------------------------------------------
String length: 5120 KB
-----------------------------------------------
Start software AESCTR
..........
7716 ms
52 mbps
software end
-----------------------------------------------
Start Better AES CTR
..........
1595 ms
263 mbps
Better end
Better faster by: 384%
-----------------------------------------------
Start BoringSSL AES CTR
..........
1680 ms
250 mbps
BoringSSL end
BoringSSL faster by: 359%
-----------------------------------------------
On all platforms other than web this package shells out to BoringSSL.
If performance is slow, it might have to do with compiler options. https://github.com/google/webcrypto.dart/blob/8ac145beef348a55f0e268f11101bc8f9a8e3fec/darwin/webcrypto.podspec#L29-L30
One could try to enable those options on Linux or Windows to see if you get similar performance degradation.
In which case it might be worth figuring out how to enable ASM on Mac/iOS. Or compile without DDOPENSSL_SMALL
not targeting Android or iOS.
If you find an improvement PRs are appreciated.
I closed while I work a little harder to solve and will raise PR once I have a solution rather than a problem :-)
I have been looking to replace/improve the AES-CTR streaming package that I am using at present (
encrypt
) which tops out at about 50mbps when using AOT.I got the webcrypto package working and see great improvements on Windows (up to 250mbps) but when testing on Mac M1 very poor results both in AOT and JIT..
When comparing with `package:better_cryptography/better_cryptography.dart' ---> Performs best in AOT/JIT 'package:encrypt/encrypt.dart'
JIT
And AOT