#1 2018-01-30 09:34:57

keinn
Member
Registered: 2014-10-20
Posts: 103

Fastest MD5 Hash algorithm On Earth!

Faster than System.Hash ,Faster than Indy,and still 50% Faster than mORMot!!!
algorithm  :https://github.com/maximmasiutin/MD5_Transform-x64
Delphi transport: https://github.com/PassByYou888/FastMD5 … st_MD5.pas

Offline

#2 2018-01-30 12:09:15

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Fastest MD5 Hash algorithm On Earth!

Well done and thanks for sharing!


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#3 2018-01-30 13:51:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,669
Website

Re: Fastest MD5 Hash algorithm On Earth!

On x86, our previous asm:

1000 md5 8 B in 180us i.e. 5555555/s, aver. 0us, 42.3 MB/s
     1000 md5 50 B in 180us i.e. 5555555/s, aver. 0us, 264.9 MB/s
     1000 md5 100 B in 332us i.e. 3012048/s, aver. 0us, 287.2 MB/s
     1000 md5 1000 B in 2.53ms i.e. 394011/s, aver. 2us, 375.7 MB/s
     1000 md5 9 KB in 26.37ms i.e. 37910/s, aver. 26us, 361.5 MB/s
     5000 md5 in 29.62ms i.e. 168776/s or 359.1 MB/s

On x86, the new asm:

1000 md5 8 B in 143us i.e. 6993006/s, aver. 0us, 53.3 MB/s
     1000 md5 50 B in 141us i.e. 7092198/s, aver. 0us, 338.1 MB/s
     1000 md5 100 B in 255us i.e. 3921568/s, aver. 0us, 373.9 MB/s
     1000 md5 1000 B in 1.90ms i.e. 524934/s, aver. 1us, 500.6 MB/s
     1000 md5 9 KB in 19.59ms i.e. 51023/s, aver. 19us, 486.5 MB/s
     5000 md5 in 22.05ms i.e. 226675/s or 482.4 MB/s

On x64, our previous pure pascal version:

1000 md5 8 B in 241us i.e. 4149377/s, aver. 0us, 31.6 MB/s
     1000 md5 50 B in 223us i.e. 4484304/s, aver. 0us, 213.8 MB/s
     1000 md5 100 B in 417us i.e. 2398081/s, aver. 0us, 228.7 MB/s
     1000 md5 1000 B in 3.41ms i.e. 292997/s, aver. 3us, 279.4 MB/s
     1000 md5 9 KB in 33.25ms i.e. 30067/s, aver. 33us, 286.7 MB/s
     5000 md5 in 37.57ms i.e. 133056/s or 283.1 MB/s

On x64, the new asm version:

1000 md5 8 B in 156us i.e. 6410256/s, aver. 0us, 48.9 MB/s
     1000 md5 50 B in 141us i.e. 7092198/s, aver. 0us, 338.1 MB/s
     1000 md5 100 B in 248us i.e. 4032258/s, aver. 0us, 384.5 MB/s
     1000 md5 1000 B in 1.76ms i.e. 565291/s, aver. 1us, 539.1 MB/s
     1000 md5 9 KB in 18.62ms i.e. 53682/s, aver. 18us, 511.9 MB/s
     5000 md5 in 20.96ms i.e. 238458/s or 507.4 MB/s

So it is definitively worth integrating it!
Check https://synopse.info/fossil/info/dd999192f1
Note that I've also ensure the code works with FPC, and is Linux x64 compatible (diverse ABI).

Even if MD5 is now seldom used, it is still faster than SHA alternatives, when you need a cryptographic hash, but can afford some collisions.
Thanks a lot for sharing!

Offline

Board footer

Powered by FluxBB