Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: de-prioritize rendering non-visible tiles #9989

Open
mmeeks opened this issue Sep 5, 2024 · 3 comments · May be fixed by #10183 or #10197
Open

perf: de-prioritize rendering non-visible tiles #9989

mmeeks opened this issue Sep 5, 2024 · 3 comments · May be fixed by #10183 or #10197
Assignees
Labels
24.04 enhancement New feature or request performance Improving COOL performance

Comments

@mmeeks
Copy link
Contributor

mmeeks commented Sep 5, 2024

In Kit.cpp (drainQueue) while we batch all the incoming input pieces first we then render all incoming tile requests.

  ```

if (processInputEnabled() && !isLoadOngoing() &&
!isBackgroundSaveProcess() && _queue->getTileQueueSize() > 0)
{
std::vector tileRequests = _queue->popWholeTileQueue();

        // Put requests that include tiles in the visible area to the front to handle those first
        std::partition(tileRequests.begin(), tileRequests.end(), [this](const TileCombined& req) {
            return isTileRequestInsideVisibleArea(req); });
        for (auto& tileCombined : tileRequests)
            renderTiles(tileCombined);
 }

We should instead while there are events to process:

a) only render & send those that are inside a visible area and
b) re-spin the main-loop  and
c) only render non-visible tiles when there is nothing else to do =)
@mmeeks mmeeks added enhancement New feature or request performance Improving COOL performance 24.04 labels Sep 5, 2024
@sgothel sgothel self-assigned this Sep 13, 2024
@sgothel
Copy link

sgothel commented Sep 16, 2024

@mmeeks is it OK for the invisible tiles requests to just vanish, i.e. being ignored iff the main-loop is busy (later on that)?
In such case .. we just issue renderTiles on the isTileRequestInsideVisibleArea requests?

Edit2: Probably need to update status to client ... side-effects etc.
Need to check on the 'busy main-loop' criteria, i.e. nothing else to do -> ProcessToIdleDeadline?

@mmeeks
Copy link
Contributor Author

mmeeks commented Sep 17, 2024

@mmeeks is it OK for the invisible tiles requests to just vanish, i.e. being ignored iff the
main-loop is busy (later on that)?

I would think c) above was quite clear on that. No it's not ok.

@sgothel
Copy link

sgothel commented Sep 17, 2024

@mmeeks is it OK for the invisible tiles requests to just vanish, i.e. being ignored iff the
main-loop is busy (later on that)?

I would think c) above was quite clear on that. No it's not ok.

Maybe a miswording, vanish is wrong. Paused until a better idle time as you wrote.
Will make a draft to discuss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
24.04 enhancement New feature or request performance Improving COOL performance
Projects
Status: No status
2 participants