Skip to content

Optimization of genBlockColumn and WeightsAt - #51

Open
tehtelev wants to merge 3 commits into
anegostudios:masterfrom
tehtelev:patch-12
Open

Optimization of genBlockColumn and WeightsAt#51
tehtelev wants to merge 3 commits into
anegostudios:masterfrom
tehtelev:patch-12

Conversation

@tehtelev

Copy link
Copy Markdown

Summary

Changes for genBlockColumn:

  • Buffer for float[] data used.

Changes for WeightsAt:

  • Loop replaced with immediate clearing of the output array, variables reused.

Performance numbers

Tested on the generation of 10200 chunk columns:

  • genBlockColumn method execution time: reduced from 16152 ms to 14678 ms;
  • genBlockColumn GC memory allocations: reduced from 639 MB to 90 MB;
  • WeightsAt method execution time: reduced from 600 ms to 10 ms;
BEFORE spoiler rockstrata before trace rockstrata before mem weightsat before trace 2026-07-11_15-59-23 2026-07-11_16-15-07
AFTER spoiler rockstrata after trace rockstrata after mem weightsat after trace stratum rocks 1 stratum rocks 2

tehtelev added 3 commits July 11, 2026 17:14
Refactor GenRockStrata class to improve performance and reduce allocations.
Refactored WeightsAt method for performance and clarity. Improved array clearing and variable reuse.
Optimize GenRockStrata implementation
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.

1 participant