Collection of optimizations to do
kristofbolyai opened this issue ยท 1 comments
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 inInventoryEmeraldCountFeature#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
callsComponentUtils.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 toWynnUtils.normalizeBadString
takes an unproportionally large part of that time. Is it really needed? Can it be made faster? -
InfoBoxFeature.render
callsManagers.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 togetUnformattedItemName()
. A suggestion here would be to use theWynnItem
cache instead. -
PlayerGhostTransparencyFeature.onPlayerArmorRender
andonTranslucentCheck
are both done on rendering, and callsisPlayerGhost
, which needs to to callgetPlayersTeam
which is expensive.
Replaced by #1002