Tuesday, 1 May 2012

Speeding up Notes applications

Our FT Search Manager product (http://www.ionetsoftware.com/search) has been around for a while now, and being a search tool, we're always trying to increase it's search speed. The latest version (4.6 - sound familiar?) is a lot faster than previous versions - FYI here's a short YouTube demo showing the faster speed achieved http://www.youtube.com/watch?v=FFcxSQ8PaIM.

If anyone's interested, here are the main methods we used to speed it up;

1. Each multi-threaded search agent only populates up to the first page of results (e.g. 10 results if that's how many results are displaying per page) then writes it's full result set to a storage document. It only populates the first X results because that's the slow part - getting data from each document. The last agent to finish assembles all the results, re-sorts them, then presents them. The first couple of pages are already available, and the remaining stubs are then populated in the background, which means the first page displays in the shortest possible time.

2. Concatenating evaluate statements. We use fields & @formulas to return document data. If there are 4 fields & @formulas required, it's much faster to execute one evaluate statement, e.g. Evaluate(@formula1 : @formula2 : @formula3 : @formula4, NotesDocument), rather than repeating it 4 times.

3. Using NotesDocument.Save only when necessary.

4. Using NotesRichTextItem.GetUnformattedText instead of GetFormattedText.

5. Using Lists to store commonly used databases, views & variables.

6. Using the LS 'Split' function as much as possible.

7. Moving everything unnecessary out of loops.

8. Performing only one @DBLookup to get all required data in one operation, then splitting the results into separate fields.

9. Storing data in Profile documents and only retrieving new data if the relevant option changes.

Hopefully someone finds these points useful.

No comments:

Post a Comment