-
Notifications
You must be signed in to change notification settings - Fork 371
Update wasmer to 2.0.0-rc1 #955
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
Conversation
Thanks. I created wasmerio/wasmer#2421. Will review tomorrow. |
By the way, loupe is helpful to get the size (computed recursively) of a Rust value. It might interest you if I remember correctly some of our past discussions :-). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, this looks easy.
Could you do some manual testing and compare the values of |
Rebased |
Rebased |
This is amazing: // Try to get module from the memory cache
if let Some(module) = cache.memory_cache.load(checksum)? {
+ println!("module.size: {}", module.size);
+ println!("loupe: {}", loupe::size_of_val(&module.module));
cache.stats.hits_memory_cache += 1;
return cache
.pinned_memory_cache
I have no idea why this happens. Should we create a separate task for investigating this and migrating to |
Yes, good idea. Could you create one? Could you then upgrade this PR to rc2 using git dependencies of Wasmer instead of crates.io? |
|
The error message suggests that we mix wasmer 2.0.0-rc1 with wasmer-types-2.0.0-rc2, which does not feel healthy |
Huh. That shouldn't have happened. I'm trying to figure out which other dependency might pull |
In cargo, |
Ahh, right. That makes sense. I just updated to |
The error you get is… unexpected. If you have time to investigate, that would be really helpful. Otherwise, please tell me, I'll try to find time to dig into that :-)! |
This is to build dramatic tension! :-) I'm very curious about that number too. |
OK, I revisited this, just out of curiosity. Here are the results:
So, either we're underestimating module sizes, or |
Thank you Mauro for this important find. Could you move this to #959 where we track the migration to loupe? |
Sure. I think that, in any case, we should use loupe's value, as it's better to over-estimate the cache usage than the opposite. |
The difference is really important though. I'm surprised by this. |
I will check the method I'm using to get the estimate Inthe first place. Probably there's something missing there. |
Turns out
2.0.0-rc2
wasn't published to crates.io, so I went with2.0.0-rc1
.loupe
is a new dependency ofwasmer
. We need to import theMemoryUsage
trait from it and implement it for a couple of our own types for things to work now.Closes #924