Musings, Written on Infinite Tape

Monday, September 13, 2004

Squeezing Performance Out Of Custom StarTeam Apps

Most of the expense in SDK apps comes from round trip transactions with the server. The SDK is set up to cache as much as it can, but you can easily throw the gains away if you're not careful.

To start, if you've got a performance issue, the SDK has a NetMonitor class. When turned on, this class provides detailed timing and bytecount information for each command. This data can be used to help identify chatty code.

When you read a property on an Item, the server grabs all the properties on the object (figuring that's the common case). If you're going through a thousand objects, this can be really slow since each object is handled individually. Instead, the populateNow() method should be used to select a subset of properties and grab them all in one shot. You can use that method on folders, including a depth parameter, or you can use an ItemList to gather objects from around the project regardless of folder structure, or for digging through object revision history. NetMonitor provides some extra help here to, noting in the log anytime a property is retrieved on an object that wasn't cached.

Of course, MPX would make this all very cheap, as changes to the properties on an object would be pushed to the client rather than pulled from the server. MPX also lets you do events (right now in Java, SDK 2005 adds support for COM and .NET events).

0 Comments:

Post a Comment

<< Home