wasm-compose: make im-rc an optional feature-guarded dependency#2459
Conversation
|
Thanks for the PR! Agreed trimming deps is a worthwhile endeavor, and agreed it makes sense in this case too. I've got a few thoughts on this as well:
|
|
(Edit: I didn't see Alex's comment before sending this, but it looks like we agree!) I would rather drop the use of The use of
but I don't actually know what he means by rolling back tentative changes, and in what way im-rc beats out std there. The docs of im-rc seem to claim that operations are close enough to O(1) for most purposes, which std's HashMap doesn't guarantee. The other thing worth saying about Given that wasm-compose is alone in taking this odd dep and wasm-compose isnt getting much use or maintenance anymore, and I expect that efforts will proceed on |
3f82f32 to
5b873da
Compare
The context here is matching resource imports to resource exports an an arbitrary component graph, which I did by speculatively matching them up and then backtracking if the match-up created a contradiction. Using an immutable data structure made that easier than manually undoing changes to a mutable map, and was cheaper than wholesale copying a map for each change. That said, I have no objection to removing the dependency. |
|
Thanks so much folks! @alexcrichton I really appreciate that thoughtful response we can definitely improve the feature selection internally. I'll probably have a few more of these prs here and there. Excited to contribute more even. |
alexcrichton
left a comment
There was a problem hiding this comment.
Sounds good!
And yeah if the cases that @dicej planned for show up I think we can brainstorm possible ideas at that point, but my hope is that by that point we'll surely have transitioned to wac... Time will tell!
|
Also, follow-up question @soldair -- we don't have a timeline/cadence for releases here in this repository, is this something which would be helpful to get into Wasmtime ASAP? Or is a more gradual cadence ok? |
|
Gradual is ok. I'm floating patches where needed. |
|
If you opt out of needing the async component model and coop threads in wasmtime, it might be possible for a wit-bindgen and wasmtime feature to enable a dep on an "LTS" version of wasm-tools that changes much less frequently. Once those features stabilize in the standards arena, their wasm-tools representations will stabilize as well, and we can then make a new LTS that provides them. Coming up with an LTS release process and threading it through those repos under a flag would be a significant engineering project, and I don't think I could volunteer any time beyond reviewing given my other priorities right now, but it could create a situation where we could help you (and the rest of the community) end up with less churn there if its desirable. It would hopefully be about the same amount of work of you creating a private patch set to achieve the same internally, and have the benefit of Alex getting to review it. |
Hey folks. Long time lurker first time contributor.
Because of potential unsafety in
im-rc's deps I've tried to make it optional for wasm-compose as it's impacting the import of wasmtime.I imagine we were using im-rc for actual performance reasons. Is there a common pattern for this use case people do instead? Is swapping it for the default HashMap going to break anything other than it being slower?
I'd love any suggestions here as to how to contribute here. It's causing quite a bit of work explaining to unsafe reviewers at google why i might need an older bitmaps and sized-chunks.