perf: 降低屏幕数据去重间隔提升帧率
- 屏幕数据去重间隔从50ms降到30ms,配合Android端50ms发送间隔 - 清理去重逻辑注释和日志中的emoji符号
This commit is contained in:
BIN
devices.db
BIN
devices.db
Binary file not shown.
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user