Closed LeonMrBonnie closed 3 years ago
I would prefer a std map here. So that the delete doesn't need O(n) by 128 players. Not sure how much difference it would make.
I would prefer a std map here. So that the delete doesn't need O(n) by 128 players. Not sure how much difference it would make.
Map with ID as key and the Entity as value?
Yes thats what i meant
@FabianTerhorst Should be fine now
Wouldnt it be possible to use v8::map so that conversion in the getter isnt needed.
Wouldnt it be possible to use v8::map so that conversion in the getter isnt needed.
A v8 map is much slower than a C++ map.
Also, the GetOrCreateEntity
does nothing else than accessing another C++ map to get the underlying stored entity, so it's very fast.
The performance with this should be fine, as there will never be more than 128 entities in stream range at once anyway.