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.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | drupal.render-ref.9.patch | 8.59 KB | sun |
| #6 | drupal_render_flatten_review.txt | 2.71 KB | chx |
| #6 | drupal_render_flatten.patch | 8.82 KB | chx |
| #3 | drupal_render_flatten.patch | 9.08 KB | chx |
| #3 | drupal_render_flatten_review.txt | 2.97 KB | chx |
Comments
Comment #1
chx commentedFor easier review, I attached a patch without the whitespace changes.
Comment #2
sunsubscribing
Comment #3
chx commentedAdded lots of comments and a missing reference in the for header.
Comment #5
sun.
Comment #6
chx commentedReplaced the ugly
forloop with a much nicerdo.Comment #7
chx commentedOh well. I presume we need an output stack too.
Comment #8
sunComment #10
sunNote 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. ;)
Comment #12
Crell commentedSubscribing.
Comment #13
chx commentedSun, your approach is even more broken than mine :) I will take the comments, thanks.
Comment #14
chx commentedComment #15
gisleOfficial tag is "API clean-up" - https://www.drupal.org/node/1207020