-
Notifications
You must be signed in to change notification settings - Fork 290
feat: Shrink trampoline size #3732
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
base: main
Are you sure you want to change the base?
Conversation
Hello @magentaqin, Thanks for the great PR! IMHO the change is not big enough to validate merged the changes right now and put time into the rest of the needed refactor. I would like to disucss a bigger overhaul of the trampoline to shrink the size even more. I feel we should get it below 1mb with ease. Let's discuss that later ;) |
I agree that it needs a bigger refactor. Let's discuss that later! |
Let's do that online when you joined Prefix.dev 🎉 I'll keep the PR open but move it to draft. |
No Problem. 👌 |
This PR is related to #2654
Optimization Result


Uncompressed size shrinks from 1.9 MB to 1.7 MB.
Before:
After:
Solution

1.use
anyhow
to replacemiette
2.use
pixi_exec_utils
to replacepixi_utils
I found removing
miette
from the root level is not enough, as its dependencypixi_utils
also relies onmiette
To avoid impacting the whole crate
pixi_utils
, I tried to extract this file into another cratepixi_exec_utils
and only import it without relying onmiette
Things left and need to discuss further
1.I haven't extracted and fully replaced
excutable_utils.rs
with the newly created cratepixi_exec_utils
, as I'm not sure whether this is the best solution and many other files depend on this file. So, it involves a lot of changes.2.I haven't write tests for trampoline as this PR is still in progress
3. I think another issue that needs further discussion: which crate/binary file needs basic error info without
miette
, and which crate/binary file needs detailed error info and diagnosis withmiette
. If needed, I can create another issue to discuss this.PR Checklist