-
Notifications
You must be signed in to change notification settings - Fork 54
render chunks faster #386
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
render chunks faster #386
Conversation
|
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 |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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*
EtlamGit
left a comment
There was a problem hiding this 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.
|
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. |
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.