Download & Extend

performance optimization: workflow_hook_info()

Project:Workflow
Version:6.x-1.5
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

Hi,

I recognized, that workflow_hook_info() binds quite a lot of execution time, if
a) you have a lot of workflow state transitions in your project (>10 or 15)
b) you display a lot of forms on a page (e.g. 5 or more)
c) you run your page not in english and you need a translation.

Trigger-module calls the hook once per form generation (via trigger_forms()) and each translation, which is done for a transition, is quite expensive caused by the workflow state name substitutions.

I am talking about execution times of (5 forms * 40 ms) = 200ms for this hook per page load.

To improve the performace, a static caching of the transitions is quite effective. Caching has to be done per language, since workflow data contains translated strings.

I added a patch, which implemented this caching and works fine for me. Executions time reduced to 1 * 40ms in my example.

AttachmentSize
workflow.module.patch3.27 KB

Comments

#1

Status:needs review» needs work

noone interested in performance issues?

#2

Other fish to fry at the moment, but if you can roll a patch against the 7.x branch I can start looking.

#3

sry, I am not working on D7 until now