LL perf (Textures/assets): Asset storage: duplicate cache probes, main-thread disk round trip, linear lists #302

Closed
opened 2026-10-04 14:09:14 +00:00 by sky_line · 2 comments
Owner

From the LL-origin inefficiency audit (finding T6). File/line references are from commit 0229f8872c; re-locate them before working.

Asset storage: duplicate cache probes, main-thread disk round trip, linear lists

  • Duplicate probes: on a miss, getExists, the constructor and getSize run twice back to back (llassetstorage.cpp:522-530).
  • Main-thread disk round trip: downloaded data goes to a temp file, then remove plus rename, all in the main-thread coroutine (llviewerassetstorage.cpp:550-569). The consumer then reads it back from disk.
  • Linear lists:
    • mPendingDownloads is a std::list scanned per request and per completion (:556, 595, 652).
    • checkForTimeouts walks all request lists twice per frame: once from processAcks (message.cpp:757-767) and once from idleNetwork (llappviewer.cpp:9750-9751).
  • Fix:
    • Drop the duplicate probe.
    • Hand the buffer straight to the callback and write to disk asynchronously.
    • Use an unordered_multimap keyed by (uuid, type).
    • Remove the duplicate timeout/retransmit call.
  • Confirmed. M.

Verify the cost (profile or timer) before and after changing it.

From the LL-origin inefficiency audit (finding T6). File/line references are from commit 0229f8872c; re-locate them before working. **Asset storage: duplicate cache probes, main-thread disk round trip, linear lists** - **Duplicate probes:** on a miss, `getExists`, the constructor and `getSize` run twice back to back (`llassetstorage.cpp:522-530`). - **Main-thread disk round trip:** downloaded data goes to a temp file, then remove plus rename, all in the main-thread coroutine (`llviewerassetstorage.cpp:550-569`). The consumer then reads it back from disk. - **Linear lists:** - `mPendingDownloads` is a `std::list` scanned per request and per completion (`:556, 595, 652`). - `checkForTimeouts` walks all request lists **twice per frame**: once from `processAcks` (`message.cpp:757-767`) and once from `idleNetwork` (`llappviewer.cpp:9750-9751`). - **Fix:** - Drop the duplicate probe. - Hand the buffer straight to the callback and write to disk asynchronously. - Use an `unordered_multimap` keyed by (uuid, type). - Remove the duplicate timeout/retransmit call. - Confirmed. M. Verify the cost (profile or timer) before and after changing it.
Author
Owner

Part of #405 (RAM/VRAM management epic).

Part of #405 (RAM/VRAM management epic).
sky_line added this to the Slipstream project 2026-10-06 15:04:14 +00:00
Author
Owner

Shipped in a published release and tested; closing (testing-lane sweep 2026-10-11).

Shipped in a published release and tested; closing (testing-lane sweep 2026-10-11).
sky_line 2026-10-11 13:24:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
sky_line/Slipstream#302
No description provided.