Add a tweakable for the prim queue preload

0.6.5-rc1
Melanie Thielker 2009-05-01 19:33:18 +00:00
parent 52d80249d3
commit 0f721da5f1
4 changed files with 22 additions and 9 deletions

View File

@ -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; }
}
/// <summary>
/// This is for llGetRegionFPS
/// </summary>
@ -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
{

View File

@ -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);

View File

@ -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; }
}
/// <summary>
/// Absolute position of this avatar in 'region cordinates'
/// </summary>
@ -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);

View File

@ -78,6 +78,9 @@
; YOU HAVE BEEN WARNED!!!
TrustBinaries = false
; How many prims to send to each avatar in the scene on each Update()
; MaxPrimsPerFrame = 200
; ##
; ## STORAGE
; ##