From e3dac1292ef000daadda3e264354d8df0fc77c22 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sat, 29 May 2010 02:10:34 -0700
Subject: Implement suspended updates - When an operation is occurring on lots
of prims in a single group, don't schedule any updates until the operation
has completed. This makes things like llSetAlpha(LINK_SET,0.0,ALL_SIDES); a
*lot* faster, more efficient and less buggy, and also makes unlinking a lot
better. Linking is still treacherous.. this needs to be analysed.
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 47 ++++++++++++++++++++-------
1 file changed, 36 insertions(+), 11 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 d4658ec..445c2c8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1499,10 +1499,13 @@ namespace OpenSim.Region.Framework.Scenes
///
protected internal void LinkObjects(SceneObjectPart root, List children)
{
+ SceneObjectGroup parentGroup = root.ParentGroup;
+ if (parentGroup == null) return;
Monitor.Enter(m_updateLock);
+
try
{
- SceneObjectGroup parentGroup = root.ParentGroup;
+ parentGroup.areUpdatesSuspended = true;
List childGroups = new List();
if (parentGroup != null)
@@ -1541,12 +1544,12 @@ namespace OpenSim.Region.Framework.Scenes
// occur on link to invoke this elsewhere (such as object selection)
parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected);
parentGroup.TriggerScriptChangedEvent(Changed.LINK);
- parentGroup.HasGroupChanged = true;
- parentGroup.ScheduleGroupForFullUpdate();
-
}
finally
{
+ parentGroup.areUpdatesSuspended = false;
+ parentGroup.HasGroupChanged = true;
+ parentGroup.ScheduleGroupForFullUpdate();
Monitor.Exit(m_updateLock);
}
}
@@ -1583,11 +1586,22 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- foreach (SceneObjectPart child in childParts)
+ if (childParts.Count > 0)
{
- // Unlink all child parts from their groups
- //
- child.ParentGroup.DelinkFromGroup(child, true);
+ try
+ {
+ childParts[0].ParentGroup.areUpdatesSuspended = true;
+ foreach (SceneObjectPart child in childParts)
+ {
+ // Unlink all child parts from their groups
+ //
+ child.ParentGroup.DelinkFromGroup(child, true);
+ }
+ }
+ finally
+ {
+ childParts[0].ParentGroup.areUpdatesSuspended = false;
+ }
}
foreach (SceneObjectPart root in rootParts)
@@ -1611,10 +1625,21 @@ namespace OpenSim.Region.Framework.Scenes
if (numChildren > 1)
sendEventsToRemainder = false;
- foreach (SceneObjectPart p in newSet)
+ if (newSet.Count > 0)
{
- if (p != group.RootPart)
- group.DelinkFromGroup(p, sendEventsToRemainder);
+ try
+ {
+ newSet[0].ParentGroup.areUpdatesSuspended = true;
+ foreach (SceneObjectPart p in newSet)
+ {
+ if (p != group.RootPart)
+ group.DelinkFromGroup(p, sendEventsToRemainder);
+ }
+ }
+ finally
+ {
+ newSet[0].ParentGroup.areUpdatesSuspended = false;
+ }
}
// If there is more than one prim remaining, we
--
cgit v1.1