diff options
author | Dan Lake | 2009-10-13 19:13:06 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-13 19:32:59 -0700 |
commit | 5976ac16b0eedaeca2360010a3d6f7be4213700a (patch) | |
tree | 8f6a80582a4640b5be0c242fd7cf2f19db39a72a /CONTRIBUTORS.txt | |
parent | * Copied LocklessQueue.cs into OpenSim.Framework and added the .Count propert... (diff) | |
download | opensim-SC_OLD-5976ac16b0eedaeca2360010a3d6f7be4213700a.zip opensim-SC_OLD-5976ac16b0eedaeca2360010a3d6f7be4213700a.tar.gz opensim-SC_OLD-5976ac16b0eedaeca2360010a3d6f7be4213700a.tar.bz2 opensim-SC_OLD-5976ac16b0eedaeca2360010a3d6f7be4213700a.tar.xz |
Optimized heartbeat by calling Update() only on updated objects.
During the heartbeat loop, Update() is called on every SceneObjectGroup which in turn checks if any SceneObjectPart has changed. For large regions (> 100k prims) this work consumes 20-30% of a CPU even though there are only a few objects updating each frame.
There is only one other reason to check every object on every frame, and that is the case where a script has registered the object with an "at target" listener. We can easily track when an object is registered or unregistered with an AtTarget, so this is not a reason to check every object every heartbeat.
In the attached patch, I have added a dictionary to the scene which tracks the objects which have At Targets. Each heartbeat, the AtTarget() function will be called on every object registered with a listener for that event. Also, I added a dictionary to SceneGraph which stores references to objects which have been queued for updates during the heartbeat. At each heartbeat, Update() is called only on the objects which have generated updates during that beat.
Diffstat (limited to 'CONTRIBUTORS.txt')
0 files changed, 0 insertions, 0 deletions