Tag Archives: performance

SharePoint List Performance (or how I saved 94%)

In a recent performance test session, I had created a thousand documents in a document library. They all had a 20 custom metadata fields filled out with data. The unit under test read all this data along with the common file information like this: SPUser user = listItem.File.CheckedOutByUser; result.CheckedOutBy = user != null ? user.LoginName [...]

Iterate folders non-recursively

Here are a few methods to help iterate complete directory trees and the files in them without using recursive method calls. The directories are read one at a time to keep memory usage at a minimum. These restrictions enables iterating trees in very large file shares. static IEnumerable<string> GetDirectories(string startDirectory) { var dirsToVisit = new Stack<string>(); [...]

SelectParallel for .NET 3.5

A simple method that does exactly what Select LINQ function does, except the items are processed as work items on the thread pool. The implementation here is best for items that takes about an equal amount of processing time, and do avoid using it for tiny work items. If an exception occurs during processing of an [...]

Fast (dynamic) DataTable load

When you stuff data in a DataTable you need to first build the columns with, then add the rows containing all of the field values. To map properties from strongly typed objects to DataTables involves either tedious error prone mapping code or a more versatile and CPU hungry way using Reflection. The small code snippet [...]

Follow

Get every new post delivered to your Inbox.