ACR Rules

⌘K
  1. Home
  2. Docs
  3. ACR Rules
  4. Performance (29)
  5. Commits should take place outside of a loop

Commits should take place outside of a loop

Introduced in version 1.4 (3 February 2020)

A loop can potentially be executed hundreds or thousands of times. Therefore it is preferable to avoid doing long-running actions in a loop.

Commits/deletes can often be placed after the loop, by creating a commit-list before the loop, changing without commit, adding changed/deleted items inside the loop and committing the commit-list at once after the loop. This saves a lot of database action.

Noncompliant microflow:

Compliant example: