General Hints to Improve Performance
The following hints cover cache reuse and model storage strategies.
Reusing Cached Rows
An application can have multiple repository instances (for example, database sessions) open at the same time. Although objects are not shared between sessions, cached rows are shared. This offers some opportunities for increased parallelism.
The repository engine shares a cache by default, so this optimization tip is already at work. Be aware that if you set the connection flag REPOS_CONN_NEWCACHE you will lose the benefit of this optimization technique.
Reusing an Interface Instance
It is more efficient to cache the result of IRepositoryItem::Interface than to call it many times in a row on the same object and interface. This avoids the cost of a COM object creation and type information lookup.
Storing an Information Model
If you are creating or extending an information model programmatically, you can improve performance by minimizing the number of tables that you use to store properties. You can minimize the number of tables by mapping multiple interfaces to the same table. To do this, before you commit the transaction that is used to create your information model, set the TableName property for each interface definition object to the same name. Since the engine must issue a separate SQL query for each table it accesses, when you reduce the number of tables, you reduce the number of database round trips. However, this may cost some space for objects that do not support or populate all the interfaces.