-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_bytes() adds significant overhead to keccak() #95
Comments
@gsalgado I believe our intent with However, I can get onboard with dropping support for |
It just added support for text/hex to eth_hash's version, but that has a significant performance impact and was not really used anywhere, so deprecating it now so that it can be removed in a future version. Closes: ethereum#95
I get why trinity would want to use eth-hash's |
Mainly because doing it implicitly on every call adds significant overhead to a performance-critical piece of code, but I'd also argue that there's no point in having a |
I think I'm now 👎 on removing |
Maybe it would help to add a note about performance in the eth-utils docs, and link to eth-hash's |
While developing Safe Tx Service we found out that a lot of time was spent on converting addresses from `bytes` to `ChecksumAddress`. Biggest part of this time was overhead added on `eth_utils` library to `keccak256` function. So we decided to use `pysha3` library (way faster than `pycryptodome`) directly. That's why we implemented new methods: - fast_keccak - fast_keccak_hex - fast_keccak_hex - fast_to_checksum_address - fast_bytes_to_checksum_address - fast_is_checksum_address This is also very relevant for the `EthereumAddressV2Field`, as it stores addresses as `bytes` on database and returns them as `ChecksumAddress` Related to: - ethereum/eth-utils#95 - ethereum/eth-hash#35
While developing Safe Tx Service we found out that a lot of time was spent on converting addresses from `bytes` to `ChecksumAddress`. Biggest part of this time was overhead added on `eth_utils` library to `keccak256` function. So we decided to use `pysha3` library (way faster than `pycryptodome`) directly. That's why we implemented new methods: - fast_keccak - fast_keccak_hex - fast_keccak_hex - fast_to_checksum_address - fast_bytes_to_checksum_address - fast_is_checksum_address This is also very relevant for the `EthereumAddressV2Field`, as it stores addresses as `bytes` on database and returns them as `ChecksumAddress` Related to: - ethereum/eth-utils#95 - ethereum/eth-hash#35
While developing Safe Tx Service we found out that a lot of time was spent on converting addresses from `bytes` to `ChecksumAddress`. Biggest part of this time was overhead added on `eth_utils` library to `keccak256` function. So we decided to use `pysha3` library (way faster than `pycryptodome`) directly. That's why we implemented new methods: - fast_keccak - fast_keccak_hex - fast_keccak_hex - fast_to_checksum_address - fast_bytes_to_checksum_address - fast_is_checksum_address This is also very relevant for the `EthereumAddressV2Field`, as it stores addresses as `bytes` on database and returns them as `ChecksumAddress` Related to: - ethereum/eth-utils#95 - ethereum/eth-hash#35
While developing Safe Tx Service we found out that a lot of time was spent on converting addresses from `bytes` to `ChecksumAddress`. Biggest part of this time was overhead added on `eth_utils` library to `keccak256` function. So we decided to use `pysha3` library (way faster than `pycryptodome`) directly. That's why we implemented new methods: - fast_keccak - fast_keccak_hex - fast_keccak_hex - fast_to_checksum_address - fast_bytes_to_checksum_address - fast_is_checksum_address This is also very relevant for the `EthereumAddressV2Field`, as it stores addresses as `bytes` on database and returns them as `ChecksumAddress` Related to: - ethereum/eth-utils#95 - ethereum/eth-hash#35
While developing Safe Tx Service we found out that a lot of time was spent on converting addresses from `bytes` to `ChecksumAddress`. Biggest part of this time was overhead added on `eth_utils` library to `keccak256` function. So we decided to use `pysha3` library (way faster than `pycryptodome`) directly. That's why we implemented new methods: - fast_keccak - fast_keccak_hex - fast_keccak_hex - fast_to_checksum_address - fast_bytes_to_checksum_address - fast_is_checksum_address This is also very relevant for the `EthereumAddressV2Field`, as it stores addresses as `bytes` on database and returns them as `ChecksumAddress` Related to: - ethereum/eth-utils#95 - ethereum/eth-hash#35
While developing Safe Tx Service we found out that a lot of time was spent on converting addresses from `bytes` to `ChecksumAddress`. Biggest part of this time was overhead added on `eth_utils` library to `keccak256` function. So we decided to use `pysha3` library (way faster than `pycryptodome`) directly. That's why we implemented new methods: - fast_keccak - fast_keccak_hex - fast_keccak_hex - fast_to_checksum_address - fast_bytes_to_checksum_address - fast_is_checksum_address This is also very relevant for the `EthereumAddressV2Field`, as it stores addresses as `bytes` on database and returns them as `ChecksumAddress` Related to: - ethereum/eth-utils#95 - ethereum/eth-hash#35
While developing Safe Tx Service we found out that a lot of time was spent on converting addresses from `bytes` to `ChecksumAddress`. Biggest part of this time was overhead added on `eth_utils` library to `keccak256` function. So we decided to use `pysha3` library (way faster than `pycryptodome`) directly. That's why we implemented new methods: - fast_keccak - fast_keccak_hex - fast_keccak_hex - fast_to_checksum_address - fast_bytes_to_checksum_address - fast_is_checksum_address This is also very relevant for the `EthereumAddressV2Field`, as it stores addresses as `bytes` on database and returns them as `ChecksumAddress` Related to: - ethereum/eth-utils#95 - ethereum/eth-hash#35
That function seems to add a big overhead to
keccak()
, and given its performance-critical nature I think we should consider dropping it (making keccak() accept onlybytes
). Here are some numbers showing the overhead it adds when compared to running the backend implementation directly:The text was updated successfully, but these errors were encountered: