Closed (won't fix)
Project:
Drupal core
Version:
6.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2011 at 20:31 UTC
Updated:
2 Jul 2014 at 03:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mikeytown2 commentedComment #2
mikeytown2 commentedComment #3
Peter Bowey commentedQuery: How does this patch measure up in light of the comments by sun?
See: http://drupal.org/node/639974#comment-3666548
Comment #4
mikeytown2 commentedThat comment was directed towards 7.x.
This patch flattens out element_children() by in-lining element_child(). Code wise they will always output the same; just element_child doesn't get called thousands of times now.
Comment #6
mikeytown2 commentedAnother round of optimizations to the code here :)
Stock:
Total Self: 92ms
Total Cumulative: 460ms
element_children() calls: 2,470
Patch #1:
Total Self: 67ms
Total Cumulative: 74ms
element_children() calls: 2,482
This Patch:
Total Self: 39ms
Total Cumulative: 39ms
element_children() calls: 2,482
Comment #7
fabsor commentedI tried this to, and I get an even better return from this, closer to about 800ms on a site with a lot of modules, including vertical tabs and node relationships. This is a pretty extreme example, but there are a lot of those out there.
This is completely unintrusive, so I don't see why we can't get this into core.
Comment #8
gábor hojtsy1. Was this already applied to Drupal 7?
2. Can we get some inline documentation about what is going on there? The issue comments explain here what is being inlined, but the code might easy be cryptic after the commit to the uninitiated.
Comment #9
mikeytown2 commentedelement_children() in D7 vs D6 are miles apart from each other, but the call to element_child() has been inlined in the D7 code, so you can say this has already been applied to Drupal 7.
Updated patch to add in a comment about in-lined code.
Comment #10
mikeytown2 commentedMoving back to RTBC as I've only added in comments to the code in question.
Comment #11
mgifford#9: drupal-optimize-element_children-1345204-9.patch queued for re-testing.
Comment #12
mgiffordIt's been RTBC for 2 years, but don't see this getting into Core for D6.