-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
cast is slow on OSX #6204
Comments
I see, the issue here is that we're trying to resolve foundry config because the bn command also supports chain aliases. we can make this a bit smarter though instead of resolving the config: foundry/crates/cast/bin/main.rs Line 231 in 1c7bf46
we should check if URL argument is none (or a valid URL and no alias) and return localhost or that URL parameter, or the flashbots URL if --flashbots and don't resolve the config |
I still don't understand why this hurts OSx build, and don't the Linux version.
And all variants:
Take roughly the same. |
Can reproduce as well. Profiling shows that 80% of the time is spent in |
Component
Cast
Have you ensured that all of these are up to date?
What version of Foundry are you on?
cast 0.2.0 (34f684d 2023-11-01T22:19:24.957042000Z)
What command(s) is the bug in?
time cast bn
Operating System
macOS (Apple Silicon)
Describe the bug
For some reason, network commands of
cast
are slow.(all measures are against a local
geth
oranvil
)time cast to-hex
takes ~25ms, buttime cast bn
takes ~200 ms.In comparison, the equivalent curl takes ~15 ms
time curl -H 'content-type: application/json' -d '{"id":1,"jsonrpc":"2.0","method":"eth_blockNumber"}' http://localhost:8545
I verified that it works better on a linux (google cloud) - 10ms for "to-hex" and 15 ms for "bn"
(note: I verified I use native "arm64" executables.
The text was updated successfully, but these errors were encountered: