GregTechCEu / GregTech

GregTech CE 1.12 fork continuing progression and development
GNU Lesser General Public License v3.0
254 stars 176 forks source link

Optimize JEI multiblock preview allocations #2629

Open TechLord22 opened 1 month ago

TechLord22 commented 1 month ago

What

Changes WorldSceneRenderer to use a Set<BlockPos> instead of a strange map, and uses Set#contains instead of a stream for TrackedDummyWorld's renderFilter predicate. This drastically reduces allocations in multiblock previews.

Outcome

Improves multiblock preview rendering performance.

Additional Information

This change breaks rendering in the terminal's auto build UI such that it does not display blocks after it auto places. I did not notice any change in the AR preview. Both of these are in a deprecated/soon to be removed state, so this should be fine for now.