ah, I see. It is definitely a worstcase performance of n*log(n): lets say half the fleet appears or disappears which means a lot of objects need to be inserted m_lostWorldObjects which means n/2 insertions. a set insertion costs log(n). This doesnt mean that this is a problem as it's really a rare case but you can't call it a linear algorithm ;)

My idea looks like this (everything unordered_sets):
lostWorldObjects = oldWorldObjects
foundWorldObjects = {}
for wo : newWorldObjects {
  existed = lostWorldObjects.erase(wo);
  if (!existed) foundWorldObjects.add(wo);
} 

this should really run in O(n) as it only iterates over one collection and erase/add is constant