Our Notes application builds Word documents. An agent creates a document collection of employee documents, then goes through the collection and builds a Word document applicable to each employee. There are several MS Word .dot files used as templates for various permutations and combinations of final Word documents, depending on each employee’s data. The agent pulls in various templates and populates various form fields in each of the templates to build the final Word document and then saves it in the Notes database as an attachment.
This is a very long process, as we have over 10,000 employees and it takes 3 - 6 seconds per employee to create each Word document. We’re trying to make the process as efficient as possible in an attempt to cut hours off the agent runtime.
It’s been suggested that instead of using a doc collection and simply looping through it, we could try to group employees with common data together so the same templates will be used for, perhaps, thousands of employees being referenced in a row, rather than jumping back and forth between employees who require different templates. The thought behind this is, as the Word template files are in use, they’re cached in the server memory. If we can group employees together, we can take better advantage of the cache and not have to constantly move templates in and out of memory. Keeping in mind that there are 15 templates and each employee requires at least 4 of the templates to build a document for them, is this an option?
So for example we have templates 1, 2, 3, 4, 5, 6, and 7 .
We access the templates for each employee as follows:
1, 2, 3, 4
1, 2, 3, 4
1, 2, 3, 4
1, 2, 5, 6, 4
1, 2, 7, 4
1, 2, 5, 6, 4
1, 2, 3, 4
Would we gain efficiency if instead we processed as follows:
1, 2, 3, 4
1, 2, 3, 4
1, 2, 3, 4
1, 2, 3, 4
1, 2, 5, 6, 4
1, 2, 5, 6, 4
1, 2, 7, 4
I’m aware that using a view or other means to group the incoming employee documents is going to be less efficient than using a document collection, therefore the gain accomplished by using/cacheing common templates may be offset by the loss of efficiency in getting away from a doc collection.
Ideas?