perf: 降低屏幕数据去重间隔提升帧率

- 屏幕数据去重间隔从50ms降到30ms,配合Android端50ms发送间隔
- 清理去重逻辑注释和日志中的emoji符号
This commit is contained in:
wdvipa
2026-02-15 20:55:36 +08:00
parent da337158b0
commit a123c7cc40
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@@ -572,14 +572,14 @@ export class MessageRouter {
return true return true
} }
// 🔧 优化去重逻辑:调整时间间隔判断,避免误杀正常数据 // 优化去重逻辑:调整时间间隔判断,避免误杀正常数据
const existingBuffer = this.screenDataBuffer.get(screenData.deviceId) const existingBuffer = this.screenDataBuffer.get(screenData.deviceId)
if (existingBuffer) { if (existingBuffer) {
// 如果有旧数据且时间间隔过短,可能是重复数据,跳过 // 如果有旧数据且时间间隔过短,可能是重复数据,跳过
const timeDiff = Date.now() - existingBuffer.timestamp const timeDiff = Date.now() - existingBuffer.timestamp
if (timeDiff < 50) { // 放宽到50ms内的重复数据才去重避免误杀正常的250ms间隔数据 if (timeDiff < 30) { // 30ms内的重复数据才去重配合50ms发送间隔
this.droppedFrames++ this.droppedFrames++
this.logger.debug(`⚠️ 跳过重复屏幕数据: 设备${screenData.deviceId}, 间隔${timeDiff}ms`) this.logger.debug(`[dedup] skip screen data: device=${screenData.deviceId}, interval=${timeDiff}ms`)
return false return false
} }
} }