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.

CommentFileSizeAuthor
workflow.module.patch3.27 KBTS79

Comments

TS79’s picture

Status: Needs review » Needs work

noone interested in performance issues?

Bastlynn’s picture

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

TS79’s picture

sry, I am not working on D7 until now

johnv’s picture

Title: performance optimization: workflow_hook_info() » performance optimization: workflow_hook_info() (D6)
Issue summary: View changes
Status: Needs work » Needs review

This is resolved in D7. (where it has been moved to new submodule workflow_actions).
Leaving this open for D6, which is unmaintained.

johnv’s picture

Status: Needs review » Closed (won't fix)

I wish there was a nicer way to clear the issue queue from 'D6-issues that are fixed in D7' then a "won't fix for D6."