From 17df4185ce09f7fb911dc72e1974231a1ff14a12 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 2 Feb 2012 18:42:27 +0000 Subject: [PATCH 1/3] Add stress tests for simple object add of 100 prim objects. Add time taken to output (this is unreliable). --- OpenSim/Tests/Torture/ObjectTortureTests.cs | 51 +++++++++++++++------ 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs index cdbaa66c63..b9764d767d 100644 --- a/OpenSim/Tests/Torture/ObjectTortureTests.cs +++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs @@ -59,33 +59,60 @@ namespace OpenSim.Tests.Torture // } [Test] - public void Test0001TenThousandObjects() + public void Test0001_10K_1PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - TestAddObjects(10000); + TestAddObjects(1, 10000); } [Test] - public void Test0002OneHundredThousandObjects() + public void Test0002_100K_1PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - TestAddObjects(100000); + TestAddObjects(1, 100000); } [Test] - public void Test0003TwoHundredThousandObjects() + public void Test0003_200K_1PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - TestAddObjects(200000); + TestAddObjects(1, 200000); } - private void TestAddObjects(int objectsToAdd) + [Test] + public void Test0011_100_100PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(100, 100); + } + + [Test] + public void Test0012_1K_100PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(100, 1000); + } + + [Test] + public void Test0013_2K_100PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(100, 2000); + } + + private void TestAddObjects(int primsInEachObject, int objectsToAdd) { UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000"); @@ -98,7 +125,7 @@ namespace OpenSim.Tests.Torture for (int i = 1; i <= objectsToAdd; i++) { - SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, ownerId, "part_", i); + SceneObjectGroup so = SceneHelpers.CreateSceneObject(primsInEachObject, ownerId, "part_", i); Assert.That(scene.AddNewSceneObject(so, false), Is.True, string.Format("Object {0} was not created", i)); } @@ -114,13 +141,9 @@ namespace OpenSim.Tests.Torture string.Format("Object {0} could not be retrieved", i)); } -// Console.WriteLine( -// "Took {0}ms, {1}MB to create {2} single prim scene objects", -// elapsed.Milliseconds, processGcAlloc / 1024 / 1024, objectsToAdd); - Console.WriteLine( - "Took {0}MB to create {1} single prim scene objects", - processGcAlloc / 1024 / 1024, objectsToAdd); + "Took {0}ms, {1}MB to create {2} objects each containing {3} prim(s)", + Math.Round(elapsed.TotalMilliseconds), processGcAlloc / 1024 / 1024, objectsToAdd, primsInEachObject); } } } \ No newline at end of file From 264c83aec4151a93647c14e317067d8646f38680 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 2 Feb 2012 22:48:36 +0000 Subject: [PATCH 2/3] Add llGetLinkNumberOfSides to LSL_Stub and ILSL_Api It already existed in LSL_Api but it also needs to exist in these two other places for a script to be able to see it. Hopefully resolves http://opensimulator.org/mantis/view.php?id=5489 --- OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | 3 ++- OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index b66537f544..6106a653b5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -138,7 +138,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Key llGetLinkKey(int linknum); LSL_String llGetLinkName(int linknum); LSL_Integer llGetLinkNumber(); - LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules); + LSL_Integer llGetLinkNumberOfSides(int link); + LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules); LSL_Integer llGetListEntryType(LSL_List src, int index); LSL_Integer llGetListLength(LSL_List src); LSL_Vector llGetLocalPos(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 840d3a4ec6..d1a5e2f585 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -539,6 +539,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_LSL_Functions.llGetLinkNumber(); } + public LSL_Integer llGetLinkNumberOfSides(int link) + { + return m_LSL_Functions.llGetLinkNumber(); + } + public LSL_Integer llGetListEntryType(LSL_List src, int index) { return m_LSL_Functions.llGetListEntryType(src, index); From 54d473e2000643d083e51a09ca31b1cd54de363b Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 2 Feb 2012 23:35:16 +0000 Subject: [PATCH 3/3] D'oh - we want to call llGetLinkNumberOfSides() in the LSL_Stub, not llGetLinkNumber(). --- OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index d1a5e2f585..83550a5933 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -541,7 +541,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public LSL_Integer llGetLinkNumberOfSides(int link) { - return m_LSL_Functions.llGetLinkNumber(); + return m_LSL_Functions.llGetLinkNumberOfSides(link); } public LSL_Integer llGetListEntryType(LSL_List src, int index)