redhat-developer / redhat-developer/vscode-java
start-up slow when opening a single .java file in empty workspace
未关闭
还没有人认领这个 Issue。
extension-start
performance
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 547
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
Use case
Open VS Code without opening any folder. Drag a .java file into the window. Java extension is expected to work immediately, but it takes several seconds.
Let's see if we have chance to improve it.
I find some clues:
- a) 2~3s after java extension starts to activate, JDTLS starts to write server logs. (client side code and launching JVM)
- b) it's another 5s before
JavaLanguageServerPluginis started. (mostly related to OSGi?) - c) initialization and follow-up building jobs are finished within 1s.
Attaching the logs.
Extension host log
[2022-09-08 13:24:51.158] [exthost] [info] ExtensionService#_doActivateExtension redhat.java, startup: false, activationEvent: 'onLanguage:java'
JDTLS log
!SESSION 2022-09-08 13:24:53.994 -----------------------------------------------
eclipse.buildId=unknown
java.version=17.0.4.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -data C:\Users\yanzh\AppData\Local\Temp\vscodesws_68b2c\jdt_ws
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:24:58.761
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:24:58.963
!MESSAGE Main thread is waiting
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:24:59.023
!MESSAGE >> initialize
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:24:59.025
!MESSAGE Initializing Java Language Server 1.16.0.202209070809
...
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:24:59.741
!MESSAGE Creating the Java project jdt.ls-java-project
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:24:59.771
!MESSAGE >> initialized
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:24:59.921
!MESSAGE Finished creating the Java project jdt.ls-java-project
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:25:00.409
!MESSAGE Workspace initialized in 691ms
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:25:00.534
!MESSAGE >> initialization job finished
...
!ENTRY org.eclipse.jdt.ls.core 1 0 2022-09-08 13:25:00.833
!MESSAGE >> build jobs finished
...
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先跟踪 onLanguage:java 的激活和 JDTLS 的启动,然后检查 JavaLanguageServerPlugin 启动前的时间间隔,尤其是报告中提到的 OSGi 初始化。重现空工作区中单个 .java 文件的流程,并比较 extension host 和 JDTLS 的时间戳;在不延迟初始化或构建完成的情况下缩短启动延迟,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, typescript, vscode
- 领域
- developer-experience, performance, tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100