Use the Apex Debugging Log File

To find possible reasons for the performance problems and identify solutions, look at the RLM_CONFIGURATOR_STATS section of the log file.

See the values for Total Execution Time, Constraints Violation Stats, and ChoicePoint Backtracking Stats.

For example, consider how the constraint engine performs with this sample constraint model. In the constraint model, the value of the volts variable is greater than 110/10000 (volts = power/amps * 9999;). The constraint engine must backtrack the power variable to find a value that satisfies the constraint, starting with 0.01, 0.02, and so on until it reaches a valid value.

1relation laptops : Laptop[1..9999];
2@(sequence = 1)
3decimal(2) power = [0..500];
4@(sequence = 1)
5int amps = [1..5];
6decimal(2)  volts = (power / amps) * laptops[Laptop];
7constraint(volts > 110);

In the log file for this constraint model, see the execution statistics for Total Execution Time, Constraints Violation Stats, and ChoicePoint Backtracking Stats:

1"rootId" : "ref_a67c6632_fa1f_40b4_8093_226a9ab8a4d0",
2"Product" : "Laptop",
3"Total Execution Time" : "676ms",
4"Constraints Execution Stats" : "Distinct: 2 Total: 132006",
5"Solving goal AndGoal([ConfigureComponentGoal(Laptop Laptop_0)]) took " : "677ms",
6"Configurator Stats" : "Total Time 677ms",
7"Number of Component" : "1",
8"Number of Variables" : "4",
9"Number of Constraints" : "1",
10"Number of Backtracks" : "49500",
11"Constraints Violation Stats" : "Distinct: 1 Total: 41250",
12"IntComparison(GT,[DecimalVar(volts)])" : "41250",
13"ChoicePoint Backtracking Stats" : "Distinct: 2 Total: 98999",
14"VariableChoicePoint(DecimalVar(power))" : "49500",
15"VariableChoicePoint(IntVar(amps))" : "49499"

Optimally, execution time for a constraint model is less than 100 milliseconds, with fewer than 1,000 backtracks and no violations. Values for the constraint model example are significantly higher, indicating that the constraint engine is performing inefficiently. To improve performance in this example, reduce the domain of the power variable without reducing the solution space. For example, define the domain as [110..500] instead of [0..500]. This change reduces the number of backtracks the constraint engine performs to find a solution.