-
Notifications
You must be signed in to change notification settings - Fork 15
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
wac_types::Package
not having its own wac_types::Types
requires re-parsing packages on every composition
#85
Comments
Would a |
Mmmm good question. There is always one different package, so just clearing one composition graph wouldn't help. But perhaps I could pre-generate a composition graph with all the utils packages pre-registered, store that in a |
While that might work just fine, it does seem like a less than ideal API experience. Let me think more on this and see if I can come up with a solution where packages can be shared well between composition graphs, eliminating the need for reparses and, ideally, a lot of remapping as it can be a bunch of unnecessary allocations. |
I won't hold up a |
The approach does work, also on v0.1.0 :)
Congratulations for publishing the first release! |
So here's what I'm currently thinking for addressing this:
|
I'm also toying with ways we can prevent remapping entirely. |
In my usecase, I need to perform several compositions that each have a different "main" component but several util components that are the same (they implement WASI, similar to what wasi-virt does but even more constrained). Previously, I was only parsing these util packages once (using
Package::from_bytes
, storing them in astd::sync::OnceLock
, and then using them in many compositions.I just updated my code to the latest version of wac on git. Now that the
wac_types::Types
are inside thewac_graph::CompositionGraph
, I can no longer cache (or at least I don't know how to) the util packages but need to re-parse them on every composition.Perhaps there could be an extra utility function, e.g.
wac_graph::CompositionGraph::register_package_with_types
, to take in anotherwac_types::Types
instance and to add all of these types to the composition graph's types and to remap the package's types into the composition graph's ones (I assume something like that was done before)?Thank you for your help and all of your amazing work on these crates!
The text was updated successfully, but these errors were encountered: