Make drupal_render iterative
chx - November 8, 2009 - 21:01
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | base system |
| Category: | task |
| Priority: | normal |
| Assigned: | chx |
| Status: | needs work |
| Issue tags: | D7 API clean-up, Performance |
Description
If tests happen to pass then I will bench this. By the use of the (known to be very fast) array_pop function and [] operator, I have implemented a simple stack to remove the recurse from drupal_render.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| drupal_render_flatten.patch | 8.46 KB | Idle | Failed: Failed to install HEAD. | View details | Re-test |

#1
For easier review, I attached a patch without the whitespace changes.
#2
subscribing
#3
Added lots of comments and a missing reference in the for header.
#4
The last submitted patch failed testing.
#5
.
#6
Replaced the ugly
forloop with a much nicerdo.#7
Oh well. I presume we need an output stack too.
#8
#9
The last submitted patch failed testing.
#10
Note that #601806: drupal_render() should not set default element properties when #type is not known contains some further optimizations to drupal_render() is about to be committed. (boils down to: skipping empty elements and not setting any global defaults)
--
Playing around with this, I think it is more complex than it needs to be.
If you disagree, then at least take over the comments. ;)
#11
The last submitted patch failed testing.
#12
Subscribing.
#13
Sun, your approach is even more broken than mine :) I will take the comments, thanks.