Skip to content

Conversation

@rmmh
Copy link
Contributor

@rmmh rmmh commented Oct 20, 2025

This addresses #385 and another hotspot I saw during rendering, but now it appears to be bottlenecked on the speed of the multithreaded work dispatching-- I am not saturating all cores during rendering.

@madmaxoft
Copy link
Contributor

Did you measure concrete gains? Like "Previous code took X ms to render N chunks, this code takes Y ms"?


QMap<qint8, ChunkSection*> sections;
QVector<ChunkSection*> sections;
int lowestSection; // this allows a "bias" for the sections vector since we want negative indices
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qint8 (=char) would be enough, but probably the compiler will not save anything then.

it.previous();
if (it.value()) {
for (int i = this->sections.size() - 1; i >= 0; --i) {
auto cs = this->sections.at(i);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which type does auto generate here?
I would use: const ChunkSection*

Copy link
Collaborator

@EtlamGit EtlamGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok for me.
I would also be interested in the performance gain we get with this.

@mrkite mrkite merged commit 940f568 into mrkite:master Oct 20, 2025
6 checks passed
@rmmh
Copy link
Contributor Author

rmmh commented Oct 20, 2025

Don't know an easy way to benchmark the ChunkRender, unfortunately this doesn't directly improve the UI FPS that much: the worker threads spend most of their time idle since the Qt signals are have high latency and rendering a single chunk is very fast.

@rmmh rmmh deleted the faster-render branch October 20, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants