Skip to content

perf: load components parallel#123

Merged
Mossaka merged 6 commits into
microsoft:mainfrom
born-in-autumn:main
Aug 11, 2025
Merged

perf: load components parallel#123
Mossaka merged 6 commits into
microsoft:mainfrom
born-in-autumn:main

Conversation

@born-in-autumn

Copy link
Copy Markdown
Contributor

Problem

Wassette MCP server experienced noticeable startup delays when loading multiple WebAssembly components due to sequential loading.

Solution

  • Replaced sequential component loading with parallel loading using futures::join_all
  • Added graceful error handling - individual component failures don't block startup
  • Maintained backward compatibility with all existing APIs

Performance Impact

  • Components now load concurrently instead of sequentially
  • Expected significant reduction in cold-start time for servers with multiple components
  • Improved user experience for VS Code extension startup

Changes

  • Added load_components_parallel() function
  • Modified LifecycleManager::new_with_policy() to use parallel loading
  • Maintained all existing error handling and logging behavior

Fixes #68

Signed-off-by: Robin <48644042+born-in-autumn@users.noreply.github.com>
perf: load components parallel
@born-in-autumn

Copy link
Copy Markdown
Contributor Author

@born-in-autumn please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.请阅读以下贡献者许可协议(CLA)。如果您同意 CLA,请回复以下信息。

@microsoft-github-policy-service agree [company="{your company}"]

Options:  选项:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.(默认 - 未指定公司)我拥有提交内容的知识产权的唯一所有权,并且我不会在为我的雇主工作过程中提交提交内容。
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.(当公司提供时)我在为我的雇主工作过程中提交意见(或者我的雇主根据合同或适用法律对我的意见书拥有知识产权)。我已获得雇主的许可,可以代表我的雇主提交意见并签订本协议。通过在下面签名,定义的术语“您”包括我和我的雇主。
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement
参与者许可协议

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the startup performance of the Wassette MCP server by implementing parallel loading of WebAssembly components instead of sequential loading.

  • Replaces sequential component loading with concurrent execution using futures::join_all
  • Adds graceful error handling where individual component failures don't prevent other components from loading
  • Maintains backward compatibility with existing APIs and error handling patterns

Comment thread crates/wassette/src/lib.rs Outdated
}
}

Ok(components)

Copilot AI Aug 9, 2025

Copy link

Choose a reason for hiding this comment

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

The indentation is inconsistent with the rest of the function. This line should align with the other statements in the function body.

Suggested change
Ok(components)
Ok(components)

Copilot uses AI. Check for mistakes.

@thomastaylor312 thomastaylor312 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is looking great, but can you run cargo +nightly fmt --all and make sure you don't have any unused exports? Should be good to go after that!

@thomastaylor312

Copy link
Copy Markdown
Collaborator

@born-in-autumn Sorry for the hassle, but my PR with some changes to the loading as well just merged and it conflicts. Shouldn't be too bad to rebase, but it will need to be done manually. If you need any help, let me know!

Signed-off-by: Robin <48644042+born-in-autumn@users.noreply.github.com>
Signed-off-by: Robin <48644042+born-in-autumn@users.noreply.github.com>
@born-in-autumn

Copy link
Copy Markdown
Contributor Author

@born-in-autumn Sorry for the hassle, but my PR with some changes to the loading as well just merged and it conflicts. Shouldn't be too bad to rebase, but it will need to be done manually. If you need any help, let me know!

@thomastaylor312 Conflicts resolved ! 🔥 and the previous code formatting issues have also been included in the latest changes,Ready for final check 👀

@born-in-autumn

Copy link
Copy Markdown
Contributor Author

@thomastaylor312 Hope you're having a great weekend! 🌞
Just flagging that all requested changes are “completed & CI-passed” when you're back online.
No rush at all - I look forward to your reply!

@Mossaka Mossaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@Mossaka Mossaka merged commit 443088a into microsoft:main Aug 11, 2025
7 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.

Slow startup time for Wassette mcp server

4 participants