You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A couple of days ago, my mod (Extended Block Shapes) received the following issue, stating what when both FerriteCore and ExtendedBlockShapes are installed, the loading takes quite a long time: SolidBlock-cn/extshape#40
I've investigated into it, and found the performance issue lies on Deduplicator.deduplicate, which is mixed-in within BasicBakedModel.Builder.addQuad by SimpleModelBuilderMixin.deduplicate.
If I use another mixin to directly "cancel" the deduplicate method at the head (which means skipping the entire deduplicate method), then the game can load swiftly.
I've also found that the deduplication does not take long time for initial several models, but takes longer time along with the expansion of Deduplicator.BAKED_QUAD_CACHE.
I monitored the time used to baking every 1000 models, and also monitored the time used to call deduplicate. Especially, as I suspect the time is spent mainly calling containsKey, I monitored the time calling containsKey 10000 times. This is my test result:
In conclusion, I suspect that BAKED_QUAD_CACHE.containsKey during the deduplicate may take too long time, which happens significantly when number of models is very high.
The text was updated successfully, but these errors were encountered:
SolidBlock-cn
changed the title
Performance issues related to deduplication models with large quantities
Performance issues related to deduplicating models with large quantities
Oct 22, 2023
A couple of days ago, my mod (Extended Block Shapes) received the following issue, stating what when both FerriteCore and ExtendedBlockShapes are installed, the loading takes quite a long time:
SolidBlock-cn/extshape#40
I've investigated into it, and found the performance issue lies on
Deduplicator.deduplicate
, which is mixed-in withinBasicBakedModel.Builder.addQuad
bySimpleModelBuilderMixin.deduplicate
.If I use another mixin to directly "cancel" the
deduplicate
method at the head (which means skipping the entirededuplicate
method), then the game can load swiftly.I've also found that the deduplication does not take long time for initial several models, but takes longer time along with the expansion of
Deduplicator.BAKED_QUAD_CACHE
.I monitored the time used to baking every 1000 models, and also monitored the time used to call
deduplicate
. Especially, as I suspect the time is spent mainly callingcontainsKey
, I monitored the time callingcontainsKey
10000 times. This is my test result:For my test code, see SolidBlock-cn/extshape@ad456c0
In conclusion, I suspect that
BAKED_QUAD_CACHE.containsKey
during thededuplicate
may take too long time, which happens significantly when number of models is very high.The text was updated successfully, but these errors were encountered: