Buuz135 / FunctionalStorage

FunctionalStorage
MIT License
30 stars 33 forks source link

Fix rebuild voxel shape cost too much time, close #314 #318

Closed SeaLoong closed 2 months ago

SeaLoong commented 3 months ago

I tested the code in my case(#314). I hardly feel any frozen.

In addition, it can decrease the time cost down to less than 100ms(in my case), just replace Shapes.join with Shapes.joinUnoptimized

SeaLoong commented 2 months ago

Performance Difference

Replace Shapes.join with Shapes.joinUnoptimized

https://github.com/user-attachments/assets/0d47b3e4-7b50-4120-b094-75afed4c3948

There is about 1s game frozen in this test case.

Using the loop implement, also using replaced join function

https://github.com/user-attachments/assets/e3e526de-f9a7-44f6-b4ec-a0c1348ceb83

You can see there is still a bit game frozen, in this test case. But it is hardly perceivable.