When talking about speed, one of the most important questions is what exactly do you need to speed up? You need to determine:

  • what queries are the most popular
  • what queries take the most time

to fix it. Some ways to fix performance are (easy to hard):

  • Add indices
  • Change classes
  • Change application architecture

Because in your case I see at least two request types which require different actions to speed them up:

  • Get last X changes
  • Get last X modified subjects

Why would you want to do that?

Here's sample production class:

Class Test.Production Extends Ens.Production
{

XData ProductionDefinition
{
<Production Name="Test.Production" TestingEnabled="true" LogGeneralTraceEvents="true">
  <Description></Description>
  <ActorPoolSize>1</ActorPoolSize>
ion>
}

}

Ens.Config.Production serialized is XData ProductionDefinition and not the class itself.

To create production class automatically you need to:

  1. Create %Dictionary.ClassDefinition object for your test production
  2. Create Ens.Config.Production object
  3. Create %Dictionary.XDataDefinition
  4. Serialize (2) into (3)
  5. Insert XData (3) into (1)
  6. Save and compile (1)