Skip to content

optimize rendering workflow/task for improving performance

Michael Prilop requested to merge improve-big-workflow-performance into main

For #1136 (closed)

Performance measurements with a large workflow:

  • 52 Tasks
  • 37 Blöcke
  • 369 ContentItems
  • 501 TaskItems

calling the API for task#show in staging mode (similar to production):

Change time (s)
current main (baseline) 5 s
remove not needed visibility checks 4,8 s
avoiding many n+1 queries 4,5 s
render minimal task for all tasks except the one being shown 0,6 s

Rendering only minimal task information improves performance by 10x. It is (in theory) sufficient to only render a full task for the task which is to be shown and minimal information for all else (displayed in sidebar). But the current UI does not load task data on navigation to such. Therefor tasks do not change their state etc.

Note: I had to alter staging config as such (one more setting now needed for local tests)

  # To make it easier running a "almost" production environment locally we must change the settings below
  config.force_ssl = false # Otherwise we have to configure local puma with certificates etc.
  config.public_file_server.enabled = true # No need to precompile assets AND serve them from root (public folder)
  config.assets.compile = true

And startet the stagin server with: SECRET_KEY_BASE=anysecret RAILS_ENV=staging rails server

Edited by Michael Prilop

Merge request reports