Closed endison1986 closed 10 months ago
Hi @endison1986 ,
unfortunately we cannot promote this PR.
As a general rule, it's much better if you open an issue before you spend your time implementing a new feature. With a dedicated issue we can discuss whether to make the change before you start implementing it.
As for this specific PR, the "size" method cannot be implemented like this even if it is intended for debugging purposes. A high performance library can't really have a method that iterates and counts all possible elements just to know how many of them there are.
The biggest issue here is that end users only see the "size()" api method and didn't expect to get an O(n) time complexity API implementation behind it - they expect to get an O(1)
dev.dominion.ecs.api.Results
addsize()
method which returns the number of entities in this result. It can be used in debugging output, data statistics and other scenarios. Please check my unit tests and benchmark, I'm not good at these, Thank you.