slash macro:

#if $$$isWINDOWS
///
    #define slash "\"
#else
///
    #define slash "/"
#endIf

That said, consider using %File API  to work with file names. I usually extract "storage directory" as an application-wide setting (normalized and validated on change) and just add a file name. This way user code can ignore most OS path differences.

SQL way (query docs, 1 means BS):

SELECT *
FROM Ens_Config.Production_EnumerateConfigItems('Your.Production', 1)

Object way:

set rs = ##class(Ens.Config.Production).EnumerateConfigItemsFunc("Your.Production", 1)
do rs.%Display()

Constants for Business Host Type (defined in EnsConstants.inc):

#define eHostTypeUnknown   0
#define eHostTypeService   1
#define eHostTypeProcess   2
#define eHostTypeOperation 3
#define eHostTypeActor     4

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)