For background on leaf optimization concepts, multiplicity levels, and tradeoffs, see Leaf Optimization in the initialize docs.
When to Use
Use this method when you’ve configured manual mode (auto: false) in your initialization options. In manual mode, the SDK won’t optimize automatically—you control exactly when optimization runs.
In auto mode (default), the SDK handles optimization automatically. You typically don’t need to call this method directly.
Method Signature
Parameters
number
Optimization multiplicity (0-5). Defaults to the value set in
optimizationOptions during initialization.Yields
object
required
Progress object containing:
step: Current step numbertotal: Total number of stepscontroller: AbortController to cancel optimization between steps