Skip to content

GECS 5.0.0-rc4 - Query Performance Optimization

Pre-release
Pre-release

Choose a tag to compare

@csprance csprance released this 15 Oct 01:56
· 399 commits to main since this release

[5.0.0-rc4] - 2025-10-14 - Query Performance Optimization

πŸš€ Performance Improvements

Massive Query Cache Key Optimization

85% faster cache key generation leading to dramatic query performance improvements:

  • Cache key generation: 283ms β†’ 43ms (85% faster)
  • Query caching: 500ms β†’ 4.7ms (99% faster)
  • Query with all: 13ms β†’ 0.55ms (96% faster)
  • Query with any: 27ms β†’ 5.6ms (79% faster)
  • Complex queries: Significantly improved scaling

Technical Details:

  • Replaced expensive str(comp) fallbacks with direct get_instance_id() calls
  • Eliminated conditional checks in cache key generation hot path
  • Implemented polynomial rolling hash with XOR for collision resistance
  • Used different prime multipliers (31, 37, 41) for component type separation

Impact:

  • Query system now scales linearly instead of exponentially
  • ECS performance optimized for large-scale applications (10,000+ entities)
  • No performance regressions in any core ECS operations
  • Cache effectiveness dramatically improved

See performance test results in reports/perf/ for detailed metrics.

Full Changelog: v5.0.0-rc3...v5.0.0-rc4