February 2008 - Posts

2008 Scripting Games

It’s the third annual Scripting Games, the biggest scripting competition of the year! As a matter of fact, it’s most likely the biggest scripting competition ever. (The fact that it may be the only scripting competition is beside the point.)

The games have already begun on Feb 15 but you have until 8 AM Feb 20 to submit the solutions for the first two events.

If you want to force yourself to learn Powershell (or Perl or VBScript) then I would suggest having a look. Even though I'm not eligible for prizes because I'm a Microsoft employee, I plan on participating to help fill in the gaps of my Powershell skills. I may also try to post my solutions (after the deadline of course :)).

Posted by puzzlehacker | 2 comment(s)
Filed under: , ,

All Outlook object model calls run on the main thread

While writing an Outlook addin, lots of people feel that they should try to help with Outlook performance by running their addin code on a background thread. While this can help in some scenarios it can actually make things worse in others, particularly if the addin is interacting primarily with the Outlook Object Model (OOM). The OOM is run in a single threaded apartment COM server, therefore every COM call is executed on the main thread of outlook.exe.

If an addin is interacting with the OOM from another apartment (i.e. on a background thread or another process) all the calls have to be marshaled to and from the server apartment (i.e. the main thread) which causes some extra overhead. This overhead is why working on a background thread could actually make performance worse and it does not exist if the addin is executing in the same apartment.

Like most things, it is a balancing act and one needs to find the proper balance for their particular situation. Just remember the key to performance is "Measure, Measure, Measure..."

More Posts