Wynntils

Wynntils

611k Downloads

Potential performance optimizations

magicus opened this issue ยท 3 comments

commented

This is what is left over from our ideas in #1002, that is not covered elsewhere. It is not obvious that any of these needs to be done, or even should be done, but I'll keep them around for now in this bug.

The list:

  • Reference WynntilsMenuScreen class in mod-init time to prevent class loading in-game
  • Guide screens should not hold all guide item stacks and they should not need to load them in-game.
  • FontRenderer.renderText calls ComponentUtils.stripColorFormatting which is uniquely expensive, and probably not needed in most cases. We should move the responsibility of sending in text without color formatting to callers, so they know if it is needed or not.
  • InfoBoxFeature.render calls Managers.Function.getLinesFromLegacyTemplate which is extremely slow. We should move it out of rendering, being done every Nth tick, and possibly look for ways to make it faster as well.
  • RemoteWynntilsUserInfoModel.onPlayerJoin is somewhat expensive, due to Managers.Net.callApi. Unclear if we can do anything about this.
  • TooltipFittingFeature.onTooltipPre apparently takes a lot of time calling getOptimalTooltipWidth, even though we should not have drawn any tooltip during the recording session. Needs to be looked at.
  • ScoreboardHandler.handleScoreboardReconstruction spends a lot of time processing the stream of reconstructedScoreboard at line 222. It also seems to be allocating a lot of objects. See if we can do this better.
commented

Pretty much obsolete now.

commented

Yes, it seems reasonable this list of issues is not relevant after the last changes to the code base.

However maybe we should do another performance testing round to see if anything new has crept up?

commented

Yes, it seems reasonable this list of issues is not relevant after the last changes to the code base.

However maybe we should do another performance testing round to see if anything new has crept up?

Yes, planned. Perhaps after 1.20.2. Or before. We will see.