I was sent an interesting article today about performance issues in Sharepoint Object Model Code. There are some interesting points in there, particularly with regards to how to structure code to minimise database calls.
It is important to realise that a lot of these mistakes would be quite easy to make, particularly for a developer more used to the windows forms environment. One I was quite taken by was when they pointed out that each discrete time the “items” element was accessed, if the results weren’t stored, it trigger a complete rowfetch from the database. That sort of thing, used in the standard way in a loop, could cause an awful lot of database access.