refactor: use faster-eth-utils for better performance#266
refactor: use faster-eth-utils for better performance#266BobTheBuidler wants to merge 13 commits intoApeWorX:mainfrom
faster-eth-utils for better performance#266Conversation
| from ape.logging import logger | ||
| from ape.utils import ManagerAccessMixin | ||
| from eth_utils import to_checksum_address | ||
| from cchecksum import to_checksum_address |
There was a problem hiding this comment.
wouldn't it make sense to re-export this via your package? (to maintain compatibility)
There was a problem hiding this comment.
Yeah that's a good idea but it isn't currently implemented and I have a bit of a pile in front of me to work thru first. Up to you how to handle it here for the time being. The faster implementation is still faster, just less magnitude of difference.
There was a problem hiding this comment.
The most recent faster-eth-utils now uses the implementation from cchecksum
So it depends on how tight you'd like the pin to be
|
Overall, what platforms/architectures does this new package support? |
|
It supports all CPython distros >= 3.8 |
|
Just # type: ignore'd the type error. |
oof, needs |
|
done |
|
bro what? evidently we can't have a type: ignore and a noqa: on the same line should we just break up that line? |
sure, sounds fine do you have any benchmarks for practical use in this repo btw? would be helpful! (as a maintainer's note, this is a pretty safe repo to introduce this dependency to as it's very performance-sensitive, but has few down-stream dependencies that are other libraries) |
|
wym "practical use"? I have benchmarks for all modules with a variety of input args. Is that what you're looking for? |
What types of issues were you thinking of here? |
I mean with silverback in action using the updated package |
I'm hesistent to do it with ape / ape plugins / our more core infra packages yet until I understand any package conflicts or impacts, however Silverback is really mostly an end-user package (not meant to be used as a library, only as a framework for bot running) so the impact is rather limited. If it works well, then we can work on introducing it up the stack |
|
wrt deps: the dependencies match the eth-utils dependencies for the version each release is based on if you use 4.x.x you should be able to drop in 4.x.x without any conflicts, and same for 5.x.x |
Oh no I don't have anything like that. But drop it in one to your most cpu-hungry bots and lmk! |
afa3044 to
b95a572
Compare
|
I just ran So I pushed the changes it made to utils.py ONLY but can't say for sure that the changes were correct for your repo config, we'll see |
|
finally, all green! |
faster-eth-utils for better performance
What I did
This PR implements faster-eth-utils, my faster fork of eth-utils.
Benchmarks are available here.
Checklist