Another small improvement of drupal_render(): conditionally call element_children().

Comments

casey’s picture

Status: Active » Needs review
casey’s picture

StatusFileSize
new1.03 KB
casey’s picture

StatusFileSize
new1.01 KB

bluh, line endings.

catch’s picture

StatusFileSize
new44.73 KB
new61.09 KB

This looks good, we already have tests for drupal_render() sorting so it's clearly passing those.

Attached before/after screenshots from kcachegrind. When displaying ten nodes, this cuts calls to element_children() by half.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Forgot to set RTBC.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

moshe weitzman’s picture

Status: Fixed » Reviewed & tested by the community

No brainer. +1.

Bojhan’s picture

Status: Reviewed & tested by the community » Fixed

You guys crossposted

yched’s picture

Status: Fixed » Active

Hm, I get node forms without title, body, nor any Field API widgets in current HEAD. Back to normal if I revert that patch :-p.

casey’s picture

me too :p how did this pass?

yched’s picture

"How did this pass".
How indeed. We do test Field API form integration, but on our 'test_entity' forms, not specifically on node forms. Not sure why this patch would act on node forms or 'test_entity' forms differently.

yched’s picture

Er, yet with body and title as fields, it's quite surprising that *0* test failed in our whole suite...

casey’s picture

Ow I do see title and body, but forms are sorted incorrectly.

catch’s picture

Status: Active » Needs review
StatusFileSize
new1.05 KB

Hm, I looked at node listing when doing the profiling, but not the forms. Here's a rollback anyway.

dries’s picture

Status: Needs review » Needs work

Rollbacked using patch #14.

casey’s picture

Status: Needs work » Closed (works as designed)

Call to element_children is necessary as it is sorting the elements (since D7).