diff options
author | John Hurliman | 2009-10-28 23:10:16 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-28 23:10:16 -0700 |
commit | 59eb378d16fd8a9e887560a2744cc798fef08263 (patch) | |
tree | 4bcb0d1f3b00ecbc17ee220928646aaba09d334c /OpenSim/Region/Framework/Scenes/SceneGraph.cs | |
parent | Always send a time dilation of 1.0 while we debug rubberbanding issues (diff) | |
download | opensim-SC_OLD-59eb378d16fd8a9e887560a2744cc798fef08263.zip opensim-SC_OLD-59eb378d16fd8a9e887560a2744cc798fef08263.tar.gz opensim-SC_OLD-59eb378d16fd8a9e887560a2744cc798fef08263.tar.bz2 opensim-SC_OLD-59eb378d16fd8a9e887560a2744cc798fef08263.tar.xz |
Small performance tweaks to code called by the heartbeat loop
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 14 |
1 files changed, 9 insertions, 5 deletions
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 | |||
369 | /// </summary> | 369 | /// </summary> |
370 | protected internal void UpdateObjectGroups() | 370 | protected internal void UpdateObjectGroups() |
371 | { | 371 | { |
372 | Dictionary<UUID, SceneObjectGroup> updates; | 372 | List<SceneObjectGroup> updates; |
373 | |||
373 | // Some updates add more updates to the updateList. | 374 | // Some updates add more updates to the updateList. |
374 | // Get the current list of updates and clear the list before iterating | 375 | // Get the current list of updates and clear the list before iterating |
375 | lock (m_updateList) | 376 | lock (m_updateList) |
376 | { | 377 | { |
377 | updates = new Dictionary<UUID, SceneObjectGroup>(m_updateList); | 378 | updates = new List<SceneObjectGroup>(m_updateList.Values); |
378 | m_updateList.Clear(); | 379 | m_updateList.Clear(); |
379 | } | 380 | } |
381 | |||
380 | // Go through all updates | 382 | // Go through all updates |
381 | foreach (KeyValuePair<UUID, SceneObjectGroup> kvp in updates) | 383 | for (int i = 0; i < updates.Count; i++) |
382 | { | 384 | { |
385 | SceneObjectGroup sog = updates[i]; | ||
386 | |||
383 | // Don't abort the whole update if one entity happens to give us an exception. | 387 | // Don't abort the whole update if one entity happens to give us an exception. |
384 | try | 388 | try |
385 | { | 389 | { |
386 | kvp.Value.Update(); | 390 | sog.Update(); |
387 | } | 391 | } |
388 | catch (Exception e) | 392 | catch (Exception e) |
389 | { | 393 | { |
390 | m_log.ErrorFormat( | 394 | m_log.ErrorFormat( |
391 | "[INNER SCENE]: Failed to update {0}, {1} - {2}", kvp.Value.Name, kvp.Value.UUID, e); | 395 | "[INNER SCENE]: Failed to update {0}, {1} - {2}", sog.Name, sog.UUID, e); |
392 | } | 396 | } |
393 | } | 397 | } |
394 | } | 398 | } |