From 59eb378d16fd8a9e887560a2744cc798fef08263 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 28 Oct 2009 23:10:16 -0700 Subject: Small performance tweaks to code called by the heartbeat loop --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index db055f9..2fdb48d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -369,26 +369,30 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal void UpdateObjectGroups() { - Dictionary updates; + List updates; + // Some updates add more updates to the updateList. // Get the current list of updates and clear the list before iterating lock (m_updateList) { - updates = new Dictionary(m_updateList); + updates = new List(m_updateList.Values); m_updateList.Clear(); } + // Go through all updates - foreach (KeyValuePair kvp in updates) + for (int i = 0; i < updates.Count; i++) { + SceneObjectGroup sog = updates[i]; + // Don't abort the whole update if one entity happens to give us an exception. try { - kvp.Value.Update(); + sog.Update(); } catch (Exception e) { m_log.ErrorFormat( - "[INNER SCENE]: Failed to update {0}, {1} - {2}", kvp.Value.Name, kvp.Value.UUID, e); + "[INNER SCENE]: Failed to update {0}, {1} - {2}", sog.Name, sog.UUID, e); } } } -- cgit v1.1