Refactor SendCoarseLocations for better performance. Instead of computing list of all locations fresh for every scene presence on every frame, we will instead compute the list once every 50 frames and send to all connected presences at that time. Also, we only add 60 items to the list when there are more than 60 presences in the scene. For 1000 users, this change yields a 99.8% reduction in list processing and a 98% reduction in network bandwidth for coarse locations.

This commit is contained in:
Dan Lake
2010-06-08 16:30:51 -07:00
committed by John Hurliman
parent 0520b62955
commit ca2abc43ad
6 changed files with 59 additions and 67 deletions

View File

@@ -3426,7 +3426,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate);
loc.Header.Reliable = false;
// Each packet can only hold around 62 avatar positions and the client clears the mini-map each time
// Each packet can only hold around 60 avatar positions and the client clears the mini-map each time
// a CoarseLocationUpdate packet is received. Oh well.
int total = Math.Min(CoarseLocations.Count, 60);