Skip to content

Flecs v4.0.1

Latest
Compare
Choose a tag to compare
@SanderMertens SanderMertens released this 16 Aug 02:44
02c8c26

Highlights

Lots of performance improvements! ๐Ÿš€

  • Queries for sparse components are up to 20x faster
  • get, get_mut, has and owns are 1.5-3x faster
  • Cached queries are 5x faster to create, and match 1.5x faster with new tables
  • Simple uncached queries are up to 2x faster than v4.0.0 (5x faster than v3.2.12)

Release notes

This version includes the following bugfixes:

  • [cpp] Fix crash when copying world object during shutdown (thanks @jpeletier!)
  • [cpp] Call populate_self recursively for simple query results (thanks @Indra-db!)
  • [core] Fix assert when toggling component from stage
  • [core] Fix command batching issue that could prevent query rematching
  • [core] Fix issues with commands for sparse components
  • [core] Fix issue with cloning named entities
  • [core] Fix assert when calling emplace after remove while deferred
  • [queries] Fix issue with not operator, traversal and wildcards
  • [queries] Fix issue with toggleable components and terms with #0 source
  • [queries] Fix issue with up traversal and (re)matching empty tables
  • [observers] Fix issue with updating observers to different callback kind
  • [observers] Fix issue with observer for sparse component (thanks @Megafunk!)
  • [systems] Fix issue with updating system to different callback kind
  • [script] Fix issue where anonymous entities wouldn't clear after script update
  • [script] Fix syntax error for scripts with only a using statement
  • [script] Fix issue where unresolved component in template didn't throw an error
  • [script] Fix issue with anonymous template instance creation
  • [script] Fix issues with partial component assignments
  • [script] Fix issues with assigning non-trivial components
  • [json] Fix issues in new deserializer, serialize full paths by default
  • [json] Fix issue with serializing entity to JSON from stage
  • [json] Fix issues with serializing sparse components
  • [json] Fix issue with serializing inherited components without reflection data
  • [rest] Ensure REST HTTP server always has valid delta_time value
  • [rest] Only enable time measurements when OS time API is initialized

This version includes the following improvements:

  • [cpp] Add flecs::ref<T> constructor that just takes an entity (thanks @RoyAwesome!)
  • [cpp] Add support for iterating sparse component queries with run callback
  • [core] Remove id and size fields from ecs_column_t
  • [core] Use one size/count member for all table columns
  • [core] Add component_map to tables to improve get/get_mut/has/owns performance
  • [core] Improve performance of ecs_table_get_*_index functions
  • [queries] Add dedicated iterator mode for queries that are fully cached
  • [queries] Add dedicated iterator mode for queries that are fully trivial
  • [queries] Don't evaluate first term of uncached queries twice
  • [queries] Reduce branching in trivial iterator code
  • [queries] Remove iterator mode that returned entities one by one
  • [queries] Replace ecs_iter_t::columns with table records array
  • [queries] Remove ecs_iter_t::ptrs
  • [queries] Reduce number of observers created per query
  • [queries] Reuse static sources/ids arrays for cached results where possible
  • [queries] Don't generate query plan for trivial queries
  • [queries] Implement fast query validation for simple queries
  • [meta] Add option to provide 0 offset without triggering automatic offset computation (thanks @Indra-db!)
  • [script] Suppress variable shadowing warning for parser on msvc
  • [json] Remove legacy (v3) deserializer
  • [log] Fix incorrect log color comparison (thanks @kagetu!)
  • [docs] Replace no_readonly with immediate in system manual
  • [docs] Fix link to migration guide
  • [docs] Fix grammar in Rust query examples (thanks @waywardmonkeys!)
  • [docs] Fix find/replace typos (thanks @waywardmonkeys!)
  • [docs] Remove references to EcsIteratble (thanks @waywardmonkeys!)
  • [misc] Create .gitattributes to preserve line endings on Windows (thanks @epreston!)
  • [ci] Prevent running workflows concurrently for same branch

Benchmark results
https://github.com/SanderMertens/ecs_benchmark/tree/bda57ec04f1cb9ebeacab8a17cf9a0c3353d267b

Breaking changes

  • Query results with inherited components now must be explicitly handled in C API (#466 (comment))
  • Sparse components must now be obtained with ecs_field_at (#466 (comment))
  • The columns/ptrs members got removed from iterators (#466 (comment))
  • Member target query results have changed (#466 (comment))

New Contributors

Full Changelog: v4.0.0...v4.0.1