Extension host freezes for a long time on startup in large client-side workspaces (workspace indexing queues every file)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript, vscode
调研方向
Start with src/utils/documentIndex.ts at indexWorkspaceFolder and src/utils/index.ts at Semaphore.release; the issue links to the relevant lines. Trace how workspace files are discovered and queued, then inspect how importability checks handle non-ObjectScript files. Reproduce with a large workspace and compare startup responsiveness; done means indexing no longer causes a long extension host freeze.
由索引模型根据 Issue 内容生成。
描述
Description
In a project workspace folder with about 300,000 files, of which only a small part are ObjectScript classes and routines, the extension host becomes unresponsive for more than a minute after every start or window reload. During that time no completions or hovers work for any extension. VS Code attributes the freeze to vscode-objectscript extension (about 90% of the sampled time):
[info] [Window] Extension host (LocalProcess pid: 27936) is unresponsive.
[warning] [Window] UNRESPONSIVE extension host: 'intersystems-community.vscode-objectscript' took 90.05% of 4508.89ms
[info] [Window] Extension host (LocalProcess pid: 27936) is responsive. <- ~65s later
Cause (v3.8.7, same on master)
indexWorkspaceFolder(documentIndex.ts#L192) runsfindFiles("{**/*}")and queues one rate-limited task per file. That is hundreds of thousands of tasks.Semaphore.release()(index.ts#L1185) dequeues withArray.prototype.shift(), which is O(n) on an array this large. Draining the queue is therefore O(n²), and most of the CPU time goes intorelease.- Every task, including those for non-ObjectScript files, calls
isImportableLocalFile. ThroughcspAppsForUriandotherDocExtsForUrithat constructs twoAtelierAPIobjects and reads the configuration, once per file.
I made sure that excluding the non-ObjectScript code folders via files.exclude removes the freeze.
Suggestions for improving behavior
- Is it possible to filter files by extension before queueing, or pass a narrower glob to
findFiles? - Alternatively, adding a setting to the extension that allows for listing project subdirectories containing ObjectScript code (or, conversely, those that do not contain ObjectScript code) might also help solve the problem.
Environment
vscode-objectscript 3.8.7, VS Code 1.145.2, Windows 11
(actually, the problem existed in earlier versions as well, I’ve only now managed to figure out what was going on)
- 主要语言
- TypeScript
- 星标
- 117
- 派生
- 59
- 平均合并
- 2 天 8 分钟
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
intersystems-community/vscode-objectscript 的其他 Issue
-
Folder import and compile reports missing User.* classes although compiling the open class succeeds可能已有人在做 @isc-bsaviano 于 1 天前认领。 未关闭bug
intersystems-community/vscode-objectscript#1900 · 3 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
-
Extesion change file encoding after save.可能已有人在做 @isc-bsaviano 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 56/100
intersystems-community/vscode-objectscript#1897 · 5 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Cant' compile未关闭
难度 3/5 1-2 天 新手友好度 35/100
intersystems-community/vscode-objectscript#1889 · 3 条评论 ·
维护者通常 1 天内回复
-
Workspace folder name can override objectscript.conn.server when it matches a server name可能重新可做 @isc-bsaviano 于 31 天前认领,目前没有进行中的 PR。 未关闭bug
intersystems-community/vscode-objectscript#1885 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
upstream
难度 4/5 3-5 天 新手友好度 45/100
intersystems-community/vscode-objectscript#1876 · 18 条评论 ·
维护者通常 1 天内回复
查看 intersystems-community/vscode-objectscript 的全部 Issue
相似的 Issue
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
bug implicit-state
难度 2/5 1-3 小时 新手友好度 76/100
-
book-layout.spec fails when the similar-books rail holds other projects' books可能已有人在做 @praetorianer777 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
praetorianer777/GoTome#373 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
Tencent/tdesign-react#4465 · 1 条评论 ·
维护者通常 1 天内回复
-
area:cards enhancement ready-for-agent
难度 2/5 1-3 小时 新手友好度 66/100
fil-donadoni/tolaria#8883 ·
维护者通常 1 天内回复