mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
docs: 合并性能分析报告并优化内存管理
将 performance-reporter.md 合入 memory-peak-analysis.md,统一分析文档。 代码优化包括:compact 峰值释放、GC 阈值触发、虚拟滚动参数调优、 HybridTransport 队列缩减、无界缓存加 LRU 淘汰、taskSummary 避免数组拷贝。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1463,6 +1463,16 @@ export function getPlanSlugCache(): Map<string, string> {
|
||||
return STATE.planSlugCache
|
||||
}
|
||||
|
||||
export function setPlanSlugCacheEntry(sessionId: string, slug: string): void {
|
||||
if (STATE.planSlugCache.size >= 50) {
|
||||
const firstKey = STATE.planSlugCache.keys().next().value
|
||||
if (firstKey !== undefined) {
|
||||
STATE.planSlugCache.delete(firstKey)
|
||||
}
|
||||
}
|
||||
STATE.planSlugCache.set(sessionId, slug)
|
||||
}
|
||||
|
||||
export function getSessionCreatedTeams(): Set<string> {
|
||||
return STATE.sessionCreatedTeams
|
||||
}
|
||||
@@ -1640,6 +1650,12 @@ export function setSystemPromptSectionCacheEntry(
|
||||
name: string,
|
||||
value: string | null,
|
||||
): void {
|
||||
if (STATE.systemPromptSectionCache.size >= 100) {
|
||||
const firstKey = STATE.systemPromptSectionCache.keys().next().value
|
||||
if (firstKey !== undefined) {
|
||||
STATE.systemPromptSectionCache.delete(firstKey)
|
||||
}
|
||||
}
|
||||
STATE.systemPromptSectionCache.set(name, value)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user