feat: improve workspaceService initialize speed #1824
Merged
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types
把工作空间连接过程中对workspace uri的watch优化成异步操作。
进而优化工作空间连接速度。
Background or solution
通过对工作空间连接过程的耗时分析与打点,发现在Storage初始化过程中会依赖workspace-service.ready,而workspace.ready需要等待watch完成。
watch的耗时大部分情况下需要300ms左右,但是在容器不稳定的情况下可能需要4s甚至更多,而且watch本身不应该阻塞工作空间的启动,因此做了异步处理。会优化极端情况下的工作空间连接速度。
附件:某些极端情况下的watch耗时
Changelog