Skip to content

Conversation

Nutomic
Copy link
Contributor

@Nutomic Nutomic commented Jun 10, 2025

This PR disables all possible dependencies for wasmtime, while the code can still compile. Its possible that some of these removed features should be enabled again if they help with debugging or improve performance. Here you can see all the default features, as well as documentation for each feature flag.

It reduces the number of dependencies from 401 to 366. I didnt check the compile time but it should also be faster.

@Nutomic Nutomic requested a review from zshipko as a code owner June 10, 2025 08:25
Co-authored-by: zach <zachshipko@gmail.com>
@Nutomic
Copy link
Contributor Author

Nutomic commented Jul 9, 2025

Is anything else needed to merge this?

@G4Vi G4Vi requested a review from zshipko July 9, 2025 13:25
@zshipko
Copy link
Contributor

zshipko commented Jul 9, 2025

My only hesitation is that we will run into some unintended side-effect of removing one of these features. Everything seems to be working as far as I can tell, and it is helpful to remove the unused features that end up bloating libextism.

One that I'm still on the fence about is threads - since it is a default feature it might be best just to bring that one back as well? I don't know if anyone really uses Extism with the wasm threads proposal, but it seems worth supporting.

@Nutomic
Copy link
Contributor Author

Nutomic commented Jul 10, 2025

Then how about this change? I added a new feature wasmtime-default-features which is enabled by default and enables all the default features for wasmtime. These can be disabled manually with default-features = false, so we can see if it works or not.

Comment on lines 46 to 60
wasmtime-default-features = [
"wasmtime/async",
"wasmtime/pooling-allocator",
'wasmtime/gc-null',
'wasmtime/profiling',
'wasmtime/parallel-compilation',
'wasmtime/pooling-allocator',
'wasmtime/demangle',
'wasmtime/addr2line',
'wasmtime/debug-builtins',
'wasmtime/runtime',
'wasmtime/component-model',
'wasmtime/threads',
'wasmtime/std',
]
Copy link
Contributor

Choose a reason for hiding this comment

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

This approach is nice! I think we can do this instead:

Suggested change
wasmtime-default-features = [
"wasmtime/async",
"wasmtime/pooling-allocator",
'wasmtime/gc-null',
'wasmtime/profiling',
'wasmtime/parallel-compilation',
'wasmtime/pooling-allocator',
'wasmtime/demangle',
'wasmtime/addr2line',
'wasmtime/debug-builtins',
'wasmtime/runtime',
'wasmtime/component-model',
'wasmtime/threads',
'wasmtime/std',
]
wasmtime-default-features = [
"wasmtime/default"
]

I will push up a commit with some small tweaks then will merge this!

@zshipko zshipko merged commit 0f4c32e into extism:main Jul 10, 2025
5 checks passed
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