-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix installing cargo-binstall
in do_main_binstall
#158
Conversation
Signed-off-by: Jiahao XU <[email protected]>
@NobodyXu do you want to run a patch release for this? |
I was actually thinking of replacing tiny-json with serde-json + serde + wa-serde-derive to see if I can make fetching the version more efficient without significantly hit compile time. If you don't like that proposal at all, then we should go ahead and have a patch release. |
Do you have performance numbers showing that tiny-json parsing is slower than the curl call to crates.io or the |
Last I checked https://crates.io/api/v1/crates/$name would download somewhere around 50k bytes of JSON. Since tiny-json parses every object/array/string, it's going to incur quite a lot allocation, where as ssrde-jsonc combined with derive would skip most of them and would only deserialise the field max_stable_version. |
When deciding where to spend time optimising, please consider https://en.wikipedia.org/wiki/Amdahl%27s_law . Get the breakdown for time spent on each bit and then make a guess at what your % speed-up will be and what that translates to for the whole run. Also remember that for CI use-cases, |
0.042[1] / 0.806[2] is 5%. This doesn't feel like something that's worth spending time optimising. [1] Assuming that jq is vaguely representitive of json parsing times, and that tiny-json will be in the same ballpark. |
I've just given you a bunch of reasons not to do it, but don't let that stop you. If the reason for switching to serde-json + serde + wa-serde-derive is because it's cooler or more maintainable then I can get behind that (I would actually love to see what happens to our |
Yeah I think we should at least try wa-serde-derive out and see how it affect compile-time and runtime performance.
I'm also thinking about this. |
I'm also thinking about this.
Since cargo-quickinstall does not use an async/network but only runs
processes, I think it's relatively easy to compile cargo-quickinstall to
wasi without any extension.
I hadn't thought about that. I was more imagining making a version of `bat`
or `ripgrep` in wasi that we could use as a universal fallback (to replace
-musl).
How would you bootstrap a wasm version of cargo-quickinstall, and what
would you use it for?
… |
We've also considered this in cargo-binstall cargo-bins/cargo-binstall#246 TL;DR is we might want to include a wasm interpreter/compiler in cargo-binstall, or checks whether the users' system supports running wasi (e.g. binfmt-ext on linux), or just use wasmer. But it will be a good start for quickinstall to build binaries for wasi and then upload it to the release.
Could be for places where we do not provide pre-built artifacts but have wasm interpreter? |
Signed-off-by: Jiahao XU [email protected]