question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:26 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, May 25, 2017

Something tells me you’re really into optimization @optimisez 😉

0reactions
rastlin86commented, Feb 24, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found