feat: add global RUST_ACCEL toggle to enable/disable rust acceleration at runtime

- Introduce RUST_ACCEL config to control all rust fast paths
- Fallback to Python implementations when disabled, preserving filter semantics
- Expose rust acceleration status in system info API
- Update CLI docs to reflect new toggle
- Add tests for runtime switch and fallback behavior
This commit is contained in:
jxxghp
2026-05-23 20:35:58 +08:00
parent 0bf228d29d
commit 0c133b7ccd
7 changed files with 151 additions and 17 deletions
+2
View File
@@ -480,6 +480,8 @@ class ConfigModel(BaseModel):
# ==================== 性能配置 ====================
# 大内存模式
BIG_MEMORY_MODE: bool = False
# Rust 加速总开关,关闭时所有 Rust 快路径回退到 Python 实现
RUST_ACCEL: bool = True
# 是否启用编码探测的性能模式
ENCODING_DETECTION_PERFORMANCE_MODE: bool = True
# 编码探测的最低置信度阈值