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: minor adjusments to chunkprocessing pipeline #4881

Merged
merged 3 commits into from
Sep 4, 2021

Conversation

pollend
Copy link
Member

@pollend pollend commented Sep 2, 2021

Some minor adjustments and cleanup to ChunkProcessingPipeline. I tried to clean up some of the intent of these methods a bit and introduced some minor performance adjustments.

  • replace set with List for createMulti. None of these collections are used like sets and the set that is used is overly defensive.
  • made LightMerger static and migrated instance of Vector3 to Vector3ic
  • simplify processChunkTasks the lambdas end up complicating how the function is evaluated. this should be a bit more clearer. i.e only process a chunk if all the required chunks are valid. lets me exit a lot earlier in the evaluation.

- replace set with List for createMulti
- made LightMerger static and migrated instance of Vector3 to Vector3ic
- simplify processChunkTasks
if (chunk != null) {
requiredChunks.add(chunk);
} else {
return;
Copy link
Member Author

Choose a reason for hiding this comment

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

we can exit a lot earlier in the evaluation.

@pollend pollend requested review from naalit, DarkWeird and skaldarnar and removed request for naalit September 3, 2021 03:08
naalit
naalit previously approved these changes Sep 3, 2021
Copy link
Contributor

@naalit naalit left a comment

Choose a reason for hiding this comment

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

This looks good to me, I like not creating LightMerger instances all the time and the rest of the changes are pretty straightforward cleanup and improvements. You might want to run "optimize imports" though, there are a lot of checkstyle warnings about unused imports.

@pollend pollend requested a review from naalit September 4, 2021 17:51
@pollend pollend merged commit 450047b into develop Sep 4, 2021
@pollend pollend added this to the v5.2.0 milestone Sep 4, 2021
@pollend pollend deleted the perf/minor-tweak-chunkprocessing-pipeline branch September 4, 2021 21:07
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.

2 participants