[Entitas:] Remove entity cache in group.GetEntities()
See original GitHub issue… and return the internal HasSet as IEnumerable to avoid memory alloc when group changes often.
Alternatively, make group enumerable like
// look closely: no group.GetEntities() call
foreach (var e in group) {
// ...
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:26 (16 by maintainers)
Top Results From Across the Web
[Entitas:] Remove entity cache in group.GetEntities() #408
The above will cause exception any time you modify the Entities which causes them to be added/removed from the group as long as...
Read more >How to remove entity with first level cache and JPA in one ...
In my persistence layer i have remove method that will remove the entities in removed state and EntitySession to commit the changes.
Read more >startkit/Entitas-CSharp
Move Jenny Unity Preferences to its own editor window Tools/Jenny/Preferences... Removed. Remove EntitasCache. Upgrade. Jenny has been decoupled from Entitas ...
Read more >C# (CSharp) Entitas Context.GetGroup Examples
GetEntities (name).Count.should_be(2); }; it["releases and removes entity from index when component gets removed"] = () => { entity1.RemoveComponent(CID.
Read more >ECS - Rebuild of Unity's upcoming - Entity Component ...
I like the new ECS approach of unitys tech-team! ... you could update the locally cached struct array only if entities are removed/added....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Something tells me you’re really into optimization @optimisez 😉
AddRange always creates a new array internally regardless if the list needs to be resized or not, at leas in Microsoft implementation:
https://stackoverflow.com/questions/2123161/listt-addrange-implementation-suboptimal
Have not tested that, but I’m like 80% sure this is also the way it’s implemented in mono.