<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
* There are quite a lot of things that should be indexed, especially those that lock while searching (which I guess more or less all of them do?) - it's become quite apparent that we have thread contention galore in the system.<BR>
* I believe that we should start looking at doing more of 'bulk' operations in the database - working with large linksets is one of those things that are really really unoptimized, for example.<BR>
* The mark for update was because we wanted to be able to create interest lists and prioritize packet sending by that. Obviously, we don't do that, but that's why we did that model in the first place. I would argue we want to move deeper into working with interest lists and pulling data instead of starting to saturate queues with stale updates.<BR>
* +1 on moving stuff out of heartbeat.<BR>
* The copies thing is simply as has been said before, the sequence is different. But of course, the payload could be the same. There could probably have been a 'broadcast' function to take a template packet and send to all clients. John Hurliman would probably be the man to do this right for us.<BR>
 <BR>
Whatever happened to the 3Di packet pool? Are we using that? Did we do the transition fully?<BR><BR>Best regards,<BR>Stefan Andersson<BR>Tribal Media AB<BR><BR><BR><BR> <BR>
<HR id=stopSpelling>
From: adam@deepthink.com.au<BR>To: opensim-dev@lists.berlios.de<BR>Date: Mon, 23 Feb 2009 04:08:34 -0500<BR>Subject: [Opensim-dev] Thoughts on performance with a profiler<BR><BR>
<STYLE>
.ExternalClass p.EC_MsoNormal, .ExternalClass li.EC_MsoNormal, .ExternalClass div.EC_MsoNormal
{margin-bottom:.0001pt;font-size:11.0pt;font-family:'Calibri','sans-serif';}
.ExternalClass a:link, .ExternalClass span.EC_MsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.EC_MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p.EC_MsoListParagraph, .ExternalClass li.EC_MsoListParagraph, .ExternalClass div.EC_MsoListParagraph
{margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;font-size:11.0pt;font-family:'Calibri','sans-serif';}
.ExternalClass span.EC_EmailStyle17
{font-family:'Calibri','sans-serif';color:windowtext;}
.ExternalClass .EC_MsoChpDefault
{;}
@page Section1
{size:612.0pt 792.0pt;}
.ExternalClass div.EC_Section1
{page:Section1;}
.ExternalClass ol
{margin-bottom:0cm;}
.ExternalClass ul
{margin-bottom:0cm;}
</STYLE>

<DIV class=EC_Section1>
<P class=EC_MsoNormal>Test region: 40,000 prims (or there abouts), running trunk. Testing a combination of factors including idle running, idle running with an avatar, etc.</P>
<P class=EC_MsoNormal> </P>
<P class=EC_MsoNormal>Random notes herein:</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'">          </SPAN></SPAN>SceneGraph.Get* methods are generally very wasteful. Lots of them use the /slow/ GetEntities method to build a list of entities before searching them. This is particularly noticeable on the GetGroupByPrim(UUID) method. EntityManager should be having indexes for these frequently accessed items.</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'">          </SPAN></SPAN>SQLite processing one-at-a-time is very slow. Inserts should be bulked for performance. I suggest running a ‘1500ms’ rule on it.</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'">          </SPAN></SPAN>Why, to send a primitive do we need to: - Mark it for updates. – Crawl through the Entities list for updates – Send updates to ClientViews, when we could just Send the update directly to viewers (EventManager.TriggerOnPrimUpdated[?])?</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'">          </SPAN></SPAN>Why does Scene.Heartbeat/Update do more than just updating frame-dependent things? Eg, why not keep Update to just: Update Physics, Process Scripts[?], etc. Out of it we move: Backup (timer?), Land update (when something happens+ timer?), Terrain backup (main backup thread?)</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'">          </SPAN></SPAN>Why build X copies of the same packet for fifteen separate clients? Why not re-use the update packet and change the agent IDs? Maybe some kind of ‘PacketMaster’ could be developed for each ClientView type which allows us to do ‘bulk’ operations like this.</P>
<P class=EC_MsoNormal> </P>
<P class=EC_MsoNormal>I have a feeling that with a few of these things fixed, performance would increase dramatically.</P>
<P class=EC_MsoNormal> </P>
<P class=EC_MsoNormal> </P></DIV></body>
</html>