Wynntils

Wynntils

611k Downloads

Collection of optimizations to do

kristofbolyai opened this issue ยท 1 comments

commented

I am creating this issue with the purpose of collecting a list of issues, relating performance. These should be always based on profiling, and the nature of the problem should be described briefly (eg. high allocation or CPU time, or both).

I have created the branch https://github.com/Wynntils/Artemis/tree/optimization, keeping track of all the work we are doing here. Preferably, the branch should be the target of all optimization related PRs. When we think it is time, we can merge into main, and come back to this issue periodically.

If you decide to work on a fix, please create a draft PR for it, so we do not waste time doing duplicate work.

Feel free to edit the list below.

The list:

  • MinimapOverlay#renderPois array allocation and sorting in render code
  • EmeraldManager#getEmeraldCountInContainer is run in render code in InventoryEmeraldCountFeature#onContainerRender
  • FontRenderer.renderText is generally slow when done from rendering code. We need to research ways to cache some partial results to speed up repeated rendering of the same text.
  • 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.
  • GearItemManager.gearIdentificationFromLore is the slowest part of parsing gear tooltips. The very first call to WynnUtils.normalizeBadString takes an unproportionally large part of that time. Is it really needed? Can it be made faster?
  • 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.
  • ItemFavoriteFeature.isFavorited is called from rendering, and is expensive due to getUnformattedItemName(). A suggestion here would be to use the WynnItem cache instead.
  • PlayerGhostTransparencyFeature.onPlayerArmorRender and onTranslucentCheck are both done on rendering, and calls isPlayerGhost, which needs to to call getPlayersTeam which is expensive.
commented

Replaced by #1002