Skip to content

Fix character generator instantiation and destruction#239

Merged
dmchaledev merged 1 commit intomainfrom
claude/fix-character-generator-08s9W
Dec 28, 2025
Merged

Fix character generator instantiation and destruction#239
dmchaledev merged 1 commit intomainfrom
claude/fix-character-generator-08s9W

Conversation

@dmchaledev
Copy link
Collaborator

Previously, generate_random_potato_info() instantiated a CharacterGenerator scene and immediately freed it for every potato created. This caused unnecessary GC pressure from repeated allocations during frequent spawning.

Implement object pooling by caching a single CharacterGenerator instance that is lazily initialized on first use and reused for all subsequent character generation calls. The pooled generator is hidden and added to the scene tree root to ensure it can access its child nodes.

Previously, generate_random_potato_info() instantiated a CharacterGenerator
scene and immediately freed it for every potato created. This caused
unnecessary GC pressure from repeated allocations during frequent spawning.

Implement object pooling by caching a single CharacterGenerator instance
that is lazily initialized on first use and reused for all subsequent
character generation calls. The pooled generator is hidden and added to
the scene tree root to ensure it can access its child nodes.
@dmchaledev dmchaledev merged commit f4ef44b into main Dec 28, 2025
0 of 2 checks passed
@dmchaledev dmchaledev deleted the claude/fix-character-generator-08s9W branch December 28, 2025 07:49
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.

2 participants