Silent's Gems

Silent's Gems

9M Downloads

[Enhancement] Server startup improvements

sscards55 opened this issue · 3 comments

commented

So when Forge starts up a server, it remaps all the block/item IDs in that world. For some reason that means it goes through all of the tooltips. You have a tooltip event subscriber that queries the oreDictionary entries of that item. This unfortunately means CPU cycles used for an ultimately pointless task and memory allotment for objects that exist only to be garbage collected.

Steps to improve

      ‪‭Only useful for loading multiple worlds per Minecraft start.
                                                      ↓
  1. Create event handlers for server started and server stopping/stopped events.
  2. Register/unregister tooltip event handler reducing world/server loading times.
  3. ...
  4. Profit
commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

commented

The problem with that is it breaks tooltip searching in JEI. Not sure how many people use that, but it's not a feature I would want to give up. I did find a small optimization for the method is question, shaves about 1.8 seconds off launch time on my system.

commented

I realized my original suggestion was probably over engineered. What about setting a flag during Server about to start and unsetting during server started and checking for that. Unless this also affects JEI.