Created
February 11, 2020 10:24
-
-
Save hackaugusto/02bf9383accebdc928f48133e6faab06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
setup = "from eth_utils import keccak" | |
run = "keccak(b'')" | |
print("keccak") | |
print(timeit.timeit(run, setup)) | |
setup = "from eth_utils import to_checksum_address" | |
run = f"to_checksum_address(b'00000000000000000000')" | |
print("to_checksum_address") | |
print(timeit.timeit(run, setup)) | |
setup = "from eth_hash.auto import keccak" | |
run = "keccak(b'')" | |
print("keccak") | |
print(timeit.timeit(run, setup)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note: the original spec was missing one transcoding -- but even with that, the non-eth_utils implementation is way faster