Sorting items takes 11,806ms on mod startup
Steveplays28 opened this issue ยท 2 comments
I optimized several aspects of the item conversion code. Here are the results I got from doing a bit of tinkering. I included a handful of compat mods to increase the amount of items.
0.12.5 (Original)
[14:02:44] [Render thread/INFO]: Registered and validated 20 Forgero packages
[14:02:44] [Render thread/INFO]: [bows-vanilla, bow-extended, biomeswevegone-compat, regions_unexplored-compat, natures_spirit-compat, bloomingnature-compat, compat_common, sword-additions, axe-additions, vein_mining_schematics, forgero-refined, pattern_mining_schematics, forgero-mastercrafted, forgero-extended, minecraft-extended, forgero-trinkets, pickaxe-additions, minecraft-vanilla, forgero-vanilla, forgero-vanilla]
[14:02:52] [Render thread/INFO]: Registered 6012 items in 6873 ms
Optimized 0.12.5
[13:57:20] [Render thread/INFO]: Registered and validated 20 Forgero packages
[13:57:20] [Render thread/INFO]: [bows-vanilla, bow-extended, biomeswevegone-compat, regions_unexplored-compat, natures_spirit-compat, bloomingnature-compat, compat_common, sword-additions, axe-additions, vein_mining_schematics, forgero-refined, pattern_mining_schematics, forgero-mastercrafted, forgero-extended, minecraft-extended, forgero-trinkets, pickaxe-additions, minecraft-vanilla, forgero-vanilla, forgero-vanilla]
[13:57:21] [Render thread/INFO]: Registered 6012 items in 553 ms
So it seems we can easily reduce the item conversion time by 1/10th of the original. The rest of the compute time seems to be spend actually instantiating the item classes. Trying do this in paralell just fails, so I don't think there's much more to be gained here.