29 using System.Diagnostics;
30 using System.Reflection;
32 using NUnit.Framework;
34 using OpenSim.Framework;
35 using OpenSim.Region.Framework.Scenes;
36 using OpenSim.Tests.Common;
38 namespace OpenSim.Tests.Performance
55 GC.WaitForPendingFinalizers();
70 TestHelpers.InMethod();
73 TestAddObjects(1, 10000);
79 TestHelpers.InMethod();
82 TestAddObjects(1, 100000);
88 TestHelpers.InMethod();
91 TestAddObjects(1, 200000);
97 TestHelpers.InMethod();
100 TestAddObjects(100, 100);
106 TestHelpers.InMethod();
109 TestAddObjects(100, 1000);
115 TestHelpers.InMethod();
118 TestAddObjects(100, 2000);
121 private void TestAddObjects(
int primsInEachObject,
int objectsToAdd)
123 UUID ownerId =
new UUID(
"F0000000-0000-0000-0000-000000000000");
132 long startGcMemory = GC.GetTotalMemory(
true);
133 DateTime start = DateTime.Now;
135 for (
int i = 1; i <= objectsToAdd; i++)
137 SceneObjectGroup so = SceneHelpers.CreateSceneObject(primsInEachObject, ownerId,
"part_", i);
138 Assert.That(scene.AddNewSceneObject(so,
false), Is.True,
string.Format(
"Object {0} was not created", i));
141 TimeSpan elapsed = DateTime.Now - start;
143 long endGcMemory = GC.GetTotalMemory(
false);
145 for (
int i = 1; i <= objectsToAdd; i++)
148 scene.GetSceneObjectGroup(TestHelpers.ParseTail(i)),
150 string.Format(
"Object {0} could not be retrieved", i));
162 "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
163 Math.Round(elapsed.TotalMilliseconds),
164 (endGcMemory - startGcMemory) / 1024 / 1024,
165 endGcMemory / 1024 / 1024,
166 startGcMemory / 1024 / 1024,
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
Helpers for setting up scenes.