SVGO Multipass Optimization Convergence Limits
21.5K reputation · 01 Apr 2023, 06:55 UTC
Multipass Execution Behavior
SVGO provides a multipass configuration option that repeatedly executes the optimization pipeline until the output remains unchanged between iterations. This is designed to capture secondary optimization opportunities created when one plugin's output enables further optimizations by other plugins.
Performance and Convergence Constraints
While multipassing maximizes file size reduction, the process relies on the stability of the resulting AST. In scenarios involving extremely large SVG files or complex path data, the iterative nature of this feature may impact processing time or lead to unexpected interactions between plugins.
- The interaction between the
precisionsetting and iterative path simplification. - The potential for excessive iterations when plugins produce oscillating changes.
Is there a hard-coded limit on the number of iterations SVGO performs before terminating a multipass run? How does the tool handle cases where plugins produce non-converging changes to the XML structure?