RateCalculator: improve efficiency (#324)
* Store `this->lastTime` and `this->lastRate` when calling `GetRate(now)` and return `this->lastRate` if `GetRate(now)` is called with `now == this->lastTime` (instead of calculating the rate again). * Reset both `this->lastTime` and `this->lastRate` to 0 when calling `Reset()` or `Update()` (to allow that immediate new calls to `GetRate()` with same `now` trigger a new rate calculation). * Avoid unnecessary calls to `GetRate()` in `RemoteBitrateEstimatorAbsSendTime` (even if no longer necessary with the changes above, but looks better).
正在显示
| ... | @@ -50,7 +50,7 @@ | ... | @@ -50,7 +50,7 @@ |
| }, | }, | ||
| "devDependencies": { | "devDependencies": { | ||
| "eslint": "^6.0.1", | "eslint": "^6.0.1", | ||
| "eslint-plugin-jest": "^22.9.0", | "eslint-plugin-jest": "^22.10.0", | ||
| "gulp": "^4.0.2", | "gulp": "^4.0.2", | ||
| "gulp-clang-format": "^1.0.27", | "gulp-clang-format": "^1.0.27", | ||
| "jest": "^24.8.0", | "jest": "^24.8.0", | ||
| ... | ... |
请
注册
或者
登录
后发表评论