Skip to content
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

Migrate away from loupe #1663

Merged
merged 5 commits into from
Apr 20, 2023
Merged

Migrate away from loupe #1663

merged 5 commits into from
Apr 20, 2023

Conversation

webmaster128
Copy link
Member

@webmaster128 webmaster128 commented Apr 19, 2023

This reverts #1041 and prepares the Wasmer 3 upgrade because loupe was refectored aways from Wasmer and is not available anymore.

Copy link
Contributor

@maurolacy maurolacy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Perhaps adding a factor to increase the estimated size is a good idea. Here on in a follow-up PR.

The factor can be based on the numbers from here: #959 (comment) (50 / 60 % increase or so).

Anyway, if all the modules are being underestimated by more or less the same amount, this is not a big deal / probably not needed.

@@ -125,17 +129,20 @@ impl FileSystemCache {
}

/// Stores a serialized module to the file system. Returns the size of the serialized module.
pub fn store(&mut self, checksum: &Checksum, module: &Module) -> VmResult<()> {
/// The serialized module size is a good approximation (~100.06 %) of the in-memory module size.
Copy link
Contributor

@maurolacy maurolacy Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This percentage (~100.06%) was derived by comparing the serialised size to the size of the memory reported by massif. As such, is not considering mmaped memory, used in the module's storage.

Better to remove this comment, or update it to account for the size discrepancy due to mmaped storage.

We can also introduce a factor to multiply this module size, to get a better estimation using the old method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, good point. Thank you!

I created #1666 for this such that we don't get blocked here.

I'll remove this comment and leave estimate_module_size to be updated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, also store is suppsed to do that: Returns the size of the serialized module.. Which is a good point. The file system cache should not worry about the in-memory size estimation.

packages/vm/src/modules/file_system_cache.rs Outdated Show resolved Hide resolved
@maurolacy
Copy link
Contributor

I see loupe being using in a couple more places. Are there plans to remove these as well? Or are these other functionalities unrelated to the new wasmer, and working fine?

@webmaster128
Copy link
Member Author

I see loupe being using in a couple more places. Are there plans to remove these as well? Or are these other functionalities unrelated to the new wasmer, and working fine?

The remaining usages are needed to keep the current Wasmer 2.3 compiling. We don't use them explicitly. When we upgrade to Wasmer 3, they will go away.

@webmaster128 webmaster128 merged commit e40146a into main Apr 20, 2023
@webmaster128 webmaster128 deleted the migrate-away-from-loupe branch April 20, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants