aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-08-28 18:15:33 +0100
committerJustin Clark-Casey (justincc)2014-08-28 18:15:33 +0100
commitf132f642b23d9d0c336354a0bc4bb95c41023c34 (patch)
treea57e83357909161af8e5b735ec93916bff9765c4 /OpenSim/Region/CoreModules
parentDon't allow update timer to invoke another scene update if the previous is st... (diff)
downloadopensim-SC-f132f642b23d9d0c336354a0bc4bb95c41023c34.zip
opensim-SC-f132f642b23d9d0c336354a0bc4bb95c41023c34.tar.gz
opensim-SC-f132f642b23d9d0c336354a0bc4bb95c41023c34.tar.bz2
opensim-SC-f132f642b23d9d0c336354a0bc4bb95c41023c34.tar.xz
On code section that rezzes single objects and attachments, reduce CPU use by reading asset XML a single time with a stream reader rather than multiple times.
Reading large XML documents (e.g. complex attachments) is CPU expensive - this must be done as few times as possible (preferably just once). Reading these documents into XmlDocument is also more resource intensive than using XmlTextReader, as per Microsoft's own publication "Improve .NET Application Performance and Scalability" Optimization of other cases will follow if this change is successful.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs1
2 files changed, 5 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index b4771fd..8528c65 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -798,7 +798,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
798 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 798 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
799 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) 799 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
800 { 800 {
801 AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); 801 AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString());
802 802
803 if (rezAsset == null) 803 if (rezAsset == null)
804 { 804 {
@@ -829,7 +829,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
829 byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); 829 byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0);
830 Vector3 pos; 830 Vector3 pos;
831 831
832 bool single = m_Scene.GetObjectsToRez(rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight); 832 bool single
833 = m_Scene.GetObjectsToRez(
834 rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight);
833 835
834 if (single) 836 if (single)
835 { 837 {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
index ad1a0e1..80b9c0a 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
@@ -111,6 +111,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
111 InventoryFolderBase objsFolder 111 InventoryFolderBase objsFolder
112 = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; 112 = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0];
113 item1.Folder = objsFolder.ID; 113 item1.Folder = objsFolder.ID;
114 item1.Flags |= (uint)InventoryItemFlags.ObjectHasMultipleItems;
114 m_scene.AddInventoryItem(item1); 115 m_scene.AddInventoryItem(item1);
115 116
116 SceneObjectGroup so 117 SceneObjectGroup so