-
Notifications
You must be signed in to change notification settings - Fork 260
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
Performance of components build with cargo-component #2980
Comments
This comment was marked as resolved.
This comment was marked as resolved.
cc @alexcrichton who's been doing some digging here. (TL; DR: the main issue is coming from the optimization level for the component itself, which was the default cargo-component template: https://github.com/radu-matei/spin-yolo/blob/92910318f050a818a4106df9e5acf40adbafb4f8/lib/Cargo.toml#L16) |
Ah yes the findings I've got so far are:
If epochs/spectre-mitigations are disabled then the performance is relatively close to native, or about what you might expect from wasm's overhead. There's still some subpar instruction selection in Cranelift that may be possible to improve on the x64 side of things. Additionally the library in use here, |
spin --version
):spin 3.2.0-pre0 (771282e0 2025-01-13)
make lib && spin build
to build everything)In the application linked in the repo above, I have two HTTP components:
/rust
-- this is a Rust HTTP handler that directly uses a Rust dependency to perform a face detection algorithm on the request body/...
-- this is also a Rust HTTP handler, but imports a Wasm component through component dependencies and executes the same logicI am seeing a significant performance difference when sending the same request to those two handlers:
The performance difference here is pretty big; any thoughts into what might be going on here?
Thanks!
The text was updated successfully, but these errors were encountered: