| id | REF-053 | |||||
|---|---|---|---|---|---|---|
| workflow | github | |||||
| github_issue | emulebb/emulebb#124 | |||||
| title | Reduce upload queue and upload list linear lookup overhead | |||||
| status | OPEN | |||||
| priority | Minor | |||||
| category | refactor | |||||
| labels |
|
|||||
| milestone | post-0.7.3 | |||||
| created | 2026-06-02 | |||||
| source | focused upload queue performance review 2026-06-02 |
Workflow status is tracked in GitHub: emulebb/emulebb#124. This local document is retained as an engineering spec/evidence record.
Several upload queue and upload list paths still rely on linear scans for membership and lookup checks. With current fixed upload slot caps this is not a major runtime issue, but the pattern is repeated in UI refresh, stale-row guards, upload-client lookup, and per-file statistics.
If broadband defaults or operator slot caps grow, these paths can become avoidable UI and timer overhead.
srchybrid/UploadListCtrl.cppchecks whether a row client is still uploading by scanning the upload list.srchybrid/UploadListCtrl.cppvisible refresh calls that liveness check per visible row.srchybrid/UploadQueue.cppGetUploadingClientStructByClient()scans active upload entries and already carries a TODO for a faster lookup.srchybrid/UploadQueue.cppfile-specific waiting and datarate helpers scan waiting/uploading lists and compare hashes for each requested file.
- Maintain an upload-client membership/index map alongside
uploadinglist. - Optionally maintain a requested-file hash index for waiting clients if profiling shows file-specific scans are meaningful.
- Keep the existing list as the ordering source of truth unless a broader container refactor is approved.
- Update maps only at the same ownership points that add, remove, retire, or reclaim upload entries.
- Add targeted tests around map/list consistency and stale-client pruning.
- Do not change upload scheduling policy or score semantics.
- Do not change upload-list ordering or visible sort behavior.
- Do not make helper-thread readers mutate upload queue containers.
- Do not replace the list container wholesale unless profiling justifies a broader refactor.
- Active upload client membership checks do not scan the entire upload list in per-row UI refresh paths.
-
GetUploadingClientStructByClient()has O(1) or otherwise bounded lookup behavior for active clients. - Map/list consistency is preserved across add, remove, retire, stale prune, reclaim, and shutdown paths.
- Existing upload scheduling and slot ordering behavior is unchanged.
- Performance counters or focused tests demonstrate the intended lookup reduction.
- focused native tests for active upload lookup consistency
- focused native tests for stale upload entry retirement and reclaim behavior
- manual Uploading list refresh smoke with multiple active slots
- x64 Debug and Release app builds before implementation commit