Christian Heimes <li...@cheimes.de> added the comment:

Simple benchmark with openssl-3.0.0-5.el9.x86_64

With custom EVP_MD cache:
$ ./python -m timeit -s "from hashlib import md5" "md5(b'12345678', 
usedforsecurity=False).digest()"500000 loops, best of 5: 520 nsec per loop
$ ./python -m timeit -s "from hashlib import sha512" "sha512(b'12345678', 
usedforsecurity=False).digest()"
500000 loops, best of 5: 730 nsec per loop

Without EVP_MD cache:
$ ./python -m timeit -s "from hashlib import md5" "md5(b'', 
usedforsecurity=False).digest()"
500000 loops, best of 5: 807 nsec per loop
$ ./python -m timeit -s "from hashlib import sha512" "sha512(b'12345678', 
usedforsecurity=False).digest()"
200000 loops, best of 5: 1.03 usec per loop

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40479>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to