v2.5.0
What's Changed
- Comprehensive performance optimization pass across the entire mod, targeting per-frame heap allocations, LINQ overhead, redundant computations, and unnecessary object creation in hot render/tick paths.
Highlights
- Eliminated LINQ usage (
.Where(),.Any(),.Select(),.Count(),.OrderBy(),.SequenceEqual()) from all render and tick paths, replacing withforeachloops and direct property checks - Cached
MeasureStringresults for NPC names, price text, bundle banner widths, and level-up text to avoid repeated per-frame font measurements - Reused
ClickableTextureComponentinstances across frames instead of allocating new ones every frame for weather icons, Robin status, seasonal berry, Queen of Sauce, traveling merchant, and birthday icons - Implemented dirty flag pattern for birthday icons to avoid recreating UI components every frame
- Cached formatted strings (
ToString(),I18ncalls, daily luck text) to avoid per-frame string allocations - Replaced per-animal string allocations in render loops with direct comparisons
- Pre-computed static day sets for game state query evaluation
- Reused
StringBuilder,List, andDictionarycollections across frames viaClear()instead of allocating new ones - Cached
TitleSafeAreaviewport lookups in local variables - Fixed
MeasureStringwidth calculation using.Xinstead of.Length()(vector magnitude)
Full Changelog: v2.4.0...v2.5.0