Changes between Initial Version and Version 1 of Ticket #1860, comment 6


Ignore:
Timestamp:
Mar 16, 2013, 11:16:15 PM (11 years ago)
Author:
wraitii

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1860, comment 6

    initial v1  
    1 sbte: frankly, none. The real problem with using a vector without the map is that if you use tons of temporary entities, you get a huge vector for no real reason, which can be seen as a memory "leak". I "solved" that issue on my version of the patch by using pointers and deleting the informations about deleted stuff, so in itself the only memory used is that of the vector (which is really negligible) but you also have to make sure that serialization works (and deserialization too, which is harder as you'd have to initialize null pointers) and that things don't get too ugly when quitting the game/simulation, and restarting it. Basically It's not really nice, and probably not extremely robust, but it's probably the fastest way to do it.
     1sbte: frankly, none. The real problem with using a vector without the map is that if you use tons of temporary entities, you get a huge vector for no real reason, which can be seen as a memory "leak". I "solved" that issue on my version of the patch by using pointers and deleting the informations about deleted stuff, so in itself the only memory used is that of the vector (which is, I believe, largely negligible) but you also have to make sure that serialization works (and deserialization too, which is harder as you'd have to initialize null pointers) and that things don't get too ugly when quitting the game/simulation, and restarting it. Basically It's not really nice, and probably not extremely robust, but it's probably the fastest way to do it.
    22
    33Quantumstate said otherwise that we could keep a map of IDs that would be [Real ID of the entity <-> index in the vector] for fast lookups without having to use this hack, but this means we'll resize the vector more often and I'm not sure it's quite as fast.