mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 09:50:21 +08:00
perf: 降低 lru_cache 上限并限制流式响应块内存占用
- 缩减 model_permissions / tiktoken / formula_engine 的 lru_cache maxsize - StreamUsageTracker 响应块增加 4MB 大小限制,超限后只计数不存储 - raw_chunks 改用 deque(maxlen=50) 避免无限增长 - HardwareTooltip 导入路径修正、tooltip 延迟归零、文案中文化
This commit is contained in:
@@ -71,7 +71,7 @@ def _iter_ast_nodes(node: ast.AST) -> Iterable[ast.AST]:
|
||||
yield from _iter_ast_nodes(child)
|
||||
|
||||
|
||||
@lru_cache(maxsize=2048)
|
||||
@lru_cache(maxsize=256)
|
||||
def _validate_expression_cached(expression: str) -> ast.Expression:
|
||||
"""
|
||||
Parse + validate an expression and cache the resulting AST.
|
||||
|
||||
Reference in New Issue
Block a user