Posts

Showing posts from April, 2015

Computing cryptography hashes: Rust, F#, D and Scala

Image
Let's compare how fast Rust, D and F# (.NET actually) at computing cryptography hashes, namely MD5, SHA1, SHA256 and SHA512. We're going to use rust-crypto cargo : Results: MD5 - 3.39s  SHA1 - 2.89s  SHA256 - 6.97s SHA512 - 4.47s Now the F# code: Results (.NET 4.5, VS 2013, F# 3.1): MD5CryptoServiceProvider - 2.32s (32% faster) SHA1CryptoServiceProvider - 2.92s (1% slower) SHA256Managed - 16.50s (236% slower) SHA256CryptoServiceProvider - 11.50s (164% slower) SHA256Cng - 11.71s (168% slower) SHA512Managed - 61.04s (1365% slower) SHA512CryptoServiceProvider - 21.88s (489% slower) SHA512Cng - 22.19s (496% slower) (.NET 4.6, VS 2015, F# 4.0): MD5CryptoServiceProvider elapled 2.55 SHA1CryptoServiceProvider elapled 2.89 SHA256Managed elapled 17.01 SHA256CryptoServiceProvider elapled 8.74 SHA256Cng elapled 8.75 SHA512Managed elapled 23.42 SHA512CryptoServiceProvider 5.81 SHA512Cng elapled 5.79 D: DMD MD5 - 16.05s (470% slower