[Haskell-cafe] haskell crypto is reaaaaaaaaaally slow

Anatoly Yakovenko aeyakovenko at gmail.com
Wed Jun 20 00:51:01 EDT 2007


yea, this still gives me 4 seconds:
module Main where

import System
import System.Time
import qualified Data.Digest.MD5 as MD5
import qualified Data.ByteString as BS

main = do
   args <- getArgs
   dt <- BS.readFile $ head args
   let unpacked = BS.unpack dt
   print $ length $! unpacked
   start <- getClockTime
   print $ MD5.hash $! unpacked
   end <- getClockTime
   print $ diffClockTimes end start

$ ./md5sum ./md5sum
633413
[194,27,77,139,124,90,48,7,141,255,193,164,169,2,128,63]
TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0,
tdSec = 4, tdPicosec = 21077000000


More information about the Haskell-Cafe mailing list