We are executing a loop for every input form element and the result is unused when the form is not submitted.

If the benchmarks show some speedup, then I recommend this for 4.7 too as there is no API change at all, we do not pass $edit to anything and do not its value when $post is FALSE.

CommentFileSizeAuthor
#5 formspeedup_0.patch1.09 KBchx
formspeedup.patch878 byteschx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

Ps. If you find it strange to assign a variable in a conditional, just think of it -- we do it for every database fetch, like while ($node = db_fetch_object($result)).

drumm’s picture

Status: Reviewed & tested by the community » Needs work

It appears that $posted is only used a little further down as the condition of an if statment and $edit is only used inside that block. Could we remove $posted and move all the logic to the second if statment?

moshe weitzman’s picture

Status: Needs work » Reviewed & tested by the community

works as designed. code looks good.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Needs review

oops. missed drumm's remark

chx’s picture

FileSize
1.09 KB

New version per drumm's remark.

drewish’s picture

+1, looks good and works for me.

drewish’s picture

Status: Needs review » Reviewed & tested by the community

moshe, gave it a +1 over IRC.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)