From 0f721da5f1f2827a286fadb8ef7207266ba2d9f1 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Fri, 1 May 2009 19:33:18 +0000
Subject: Add a tweakable for the prim queue preload
---
OpenSim/Region/Framework/Scenes/Scene.cs | 9 +++++++++
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 1 +
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 +++++++++---------
3 files changed, 19 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 73daab8..638187b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -168,6 +168,7 @@ namespace OpenSim.Region.Framework.Scenes
private volatile bool shuttingdown = false;
private int m_lastUpdate = Environment.TickCount;
+ private int m_maxPrimsPerFrame = 200;
private object m_deleting_scene_object = new object();
@@ -229,6 +230,12 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_timedilation; }
}
+ public int MaxPrimsPerFrame
+ {
+ get { return m_maxPrimsPerFrame; }
+ set { m_maxPrimsPerFrame = value; }
+ }
+
///
/// This is for llGetRegionFPS
///
@@ -372,6 +379,8 @@ namespace OpenSim.Region.Framework.Scenes
m_persistAfter *= 10000000;
m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine");
+
+ m_maxPrimsPerFrame = startupConfig.GetInt("MaxPrimsPerFrame", 200);
}
catch
{
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 4b4461f..7f23b7a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -617,6 +617,7 @@ namespace OpenSim.Region.Framework.Scenes
newAvatar = new ScenePresence(client, m_parentScene, m_regInfo, appearance);
newAvatar.IsChildAgent = true;
+ newAvatar.MaxPrimsPerFrame = m_parentScene.MaxPrimsPerFrame;
AddScenePresence(newAvatar);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 50cebfb..7e1063d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -141,6 +141,8 @@ namespace OpenSim.Region.Framework.Scenes
private Vector3 m_lastVelocity = Vector3.Zero;
+ private int m_maxPrimsPerFrame = 200;
+
// Default AV Height
private float m_avHeight = 127.0f;
@@ -392,6 +394,12 @@ namespace OpenSim.Region.Framework.Scenes
set { m_parentPosition = value; }
}
+ public int MaxPrimsPerFrame
+ {
+ get { return m_maxPrimsPerFrame; }
+ set { m_maxPrimsPerFrame = value; }
+ }
+
///
/// Absolute position of this avatar in 'region cordinates'
///
@@ -747,7 +755,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- while (m_pendingObjects != null && m_pendingObjects.Count > 0 && m_partsUpdateQueue.Count < 60)
+ while (m_pendingObjects != null && m_pendingObjects.Count > 0 && m_partsUpdateQueue.Count < m_maxPrimsPerFrame)
{
SceneObjectGroup g = m_pendingObjects.Dequeue();
@@ -763,8 +771,6 @@ namespace OpenSim.Region.Framework.Scenes
g.ScheduleFullUpdateToAvatar(this);
}
- int updateCount = 0;
-
while (m_partsUpdateQueue.Count > 0)
{
SceneObjectPart part = m_partsUpdateQueue.Dequeue();
@@ -798,7 +804,6 @@ namespace OpenSim.Region.Framework.Scenes
update.LastFullUpdateTime = part.TimeStampFull;
- updateCount++;
}
else if (update.LastTerseUpdateTime <= part.TimeStampTerse)
{
@@ -809,7 +814,6 @@ namespace OpenSim.Region.Framework.Scenes
part.SendTerseUpdateToClient(ControllingClient);
update.LastTerseUpdateTime = part.TimeStampTerse;
- updateCount++;
}
}
else
@@ -833,11 +837,7 @@ namespace OpenSim.Region.Framework.Scenes
part.SendFullUpdate(ControllingClient,
GenerateClientFlags(part.UUID));
- updateCount++;
}
-
- if (updateCount > 200)
- break;
}
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
--
cgit v1.1