a fix of frequently creating instances when rendering upgraded cards #449
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In card library, if you viewing upgraded cards -- both in library and in single card view, the game will new a temporary instance of cards to render. This happened in every frame and a new instance of AbstractCard means heap consumption from portrait (AtlasRegion object) of the card. Thus, I noticed a heavy use of heap when viewing upgraded cards.

Graph above running with BaseMod v5.55.3 only
Thus, I added two patches to make SingleCardViewPopup and AbstractCard create new instance if need. There is still constantly consuming heap, but the speed is much smaller.

Graph above running with BaseMod v5.55.3 and my patches
The only problem is that I use SpireReturn in patching AbstractCard.renderInLibrary (in RenderInLibrary.java). I am not sure whether it means problems or not.