Skip to content

Conversation

@csprance
Copy link
Owner

@csprance csprance commented Nov 4, 2025

Summary

  • remove the unused QueryBuilder pooling logic from World.query so builders are always freshly constructed
  • document the removal in the changelog

Testing

  • not run

https://chatgpt.com/codex/tasks/task_e_69091e6a4b0883279d2bcfa383fe3b8d

Summary by CodeRabbit

  • Removed
    • Removed QueryBuilder pooling infrastructure from the ECS world. Query operations now create fresh builder instances instead of reusing pooled ones, improving predictability and lifecycle clarity while maintaining cache invalidation behavior.
@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

Walkthrough

The QueryBuilder pooling infrastructure has been removed from the World class. The query getter now creates fresh QueryBuilder instances on each access rather than retrieving from a reusable pool, while cache invalidation wiring is retained.

Changes

Cohort / File(s) Summary
Documentation Updates
CHANGELOG.md
Added Unreleased section documenting removal of QueryBuilder pooling infrastructure and cache invalidation wiring retention.
QueryBuilder Pooling Removal
addons/gecs/ecs/world.gd
Removed pool-based optimization: deleted _query_builder_pool, _pool_size_limit, and _return_query_builder_to_pool() method. Query getter now creates fresh QueryBuilder instances per access while maintaining cache invalidation connections.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Straightforward removal of pooling mechanism with no complex logic changes
  • Homogeneous edits (deletions of pool-related declarations and method)
  • Minimal files affected (documentation + implementation)

Poem

🐰 Pooling pools are cleared away,
Fresh builders greet us every day!
No recycling, no delay—
Cache still glows, hooray, hooray!

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Remove unused QueryBuilder pooling' is clear, concise, and directly describes the main change: removal of pooling infrastructure from QueryBuilder.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/review-and-optimize-ecs-for-speed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
addons/gecs/ecs/world.gd (1)

76-77: Optional: Simplify redundant signal connection check.

Since q is a fresh QueryBuilder instance created on line 75, the condition not cache_invalidated.is_connected(q.invalidate_cache) will always evaluate to true. The check is harmless but unnecessary.

Apply this diff to simplify:

 var query: QueryBuilder:
 	get:
 		var q: QueryBuilder = QueryBuilder.new(self)
-		if not cache_invalidated.is_connected(q.invalidate_cache):
-			cache_invalidated.connect(q.invalidate_cache)
+		cache_invalidated.connect(q.invalidate_cache)
 		return q
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a703b47 and 738c1b1.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • addons/gecs/ecs/world.gd (1 hunks)
🔇 Additional comments (2)
addons/gecs/ecs/world.gd (1)

70-78: Pooling removal implemented correctly.

The fresh QueryBuilder creation on each access is straightforward and aligns with the goal of predictable lifecycle management. The cache invalidation wiring is preserved as documented.

CHANGELOG.md (1)

3-7: LGTM! Clear and accurate documentation.

The changelog entry accurately describes the removal of QueryBuilder pooling and explains the rationale. The wording about "clarity and predictable lifecycle management" aligns well with the implementation changes.

@csprance csprance merged commit 95396fc into main Nov 4, 2025
1 check passed
@csprance csprance deleted the codex/review-and-optimize-ecs-for-speed branch November 4, 2025 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants