Skip to content

Perf/Optimize particle tracking and CharacterConfig caching - #8

Open
Haerbin23456 wants to merge 2 commits into
AAA1459:devfrom
Haerbin23456:perf/defer-particle-tracked-type-checks
Open

Perf/Optimize particle tracking and CharacterConfig caching#8
Haerbin23456 wants to merge 2 commits into
AAA1459:devfrom
Haerbin23456:perf/defer-particle-tracked-type-checks

Conversation

@Haerbin23456

Copy link
Copy Markdown

I used Codex to implement these changes. I reviewed all changes and tested them in game.

Overview

This PR contains two performance improvements for high-frequency gameplay paths:

  1. Move two special particle target type checks out of every EntityList.Update call and perform them only when particle replacement is attempted.
  2. Bind CharacterConfig for SpriteBank-managed Sprites when SpriteBank.Create / CreateOn completes, instead of repeatedly checking their resource source in CharacterConfig.For.

The intent is to preserve existing behavior while reducing repeated work.

Particle entity tracking

Previously, every entity update checked for NPC05_Badeline and CS10_HubIntro in order to redirect particle ownership to their shadow or booster.

These checks are now performed only when particle replacement is actually attempted. EntityList.Update only records the current entity.

CharacterConfig caching

For SpriteBank-managed Sprites, SpriteData and resource sources are already known when Create / CreateOn finishes.

The new implementation updates SpriteDataCache and binds CharacterConfig at that point. CharacterConfig.For can then normally return the cached binding directly.

Ordinary Image instances still use lazy resolution when their Texture reference changes.

CharacterConfig instances remain per-Sprite.

Testing

Manually tested in game with no functional issues observed.

@Haerbin23456
Haerbin23456 force-pushed the perf/defer-particle-tracked-type-checks branch 2 times, most recently from 4b7a521 to 47e73b0 Compare September 7, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant