From 7e72afcb3e9d5467ad4dd2e6ba5d1e0632d77877 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 3 Dec 2010 00:08:58 +0000
Subject: Only force prim persistence before delete if the prim is the result
of an unpersisted delink
This considerably improves delete performance for objects with large linksets
---
OpenSim/Region/Framework/Scenes/Scene.cs | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 90223b1..66c6924 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1997,7 +1997,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Object Id
/// Suppress broadcasting changes to other clients.
public void DeleteSceneObject(SceneObjectGroup group, bool silent)
- {
+ {
// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID);
//SceneObjectPart rootPart = group.GetChildPart(group.UUID);
@@ -2038,7 +2038,7 @@ namespace OpenSim.Region.Framework.Scenes
group.DeleteGroupFromScene(silent);
-// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID);
+// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID);
}
///
@@ -2057,9 +2057,12 @@ namespace OpenSim.Region.Framework.Scenes
// Force a database update so that the scene object group ID is accurate. It's possible that the
// group has recently been delinked from another group but that this change has not been persisted
// to the DB.
- ForceSceneObjectBackup(so);
+ // This is an expensive thing to do so only do it if absolutely necessary.
+ if (so.HasGroupChangedDueToDelink)
+ ForceSceneObjectBackup(so);
+
so.DetachFromBackup();
- SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID);
+ SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID);
}
// We need to keep track of this state in case this group is still queued for further backup.
--
cgit v1.1