Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
HS stores:
- the parameters passed to a form definition function
- the names of the form items, to know which part to render
- the path of the file in which the form definition function lives
All of this could be passed via Drupal.settings and then POSTed each time. This removes the need for a cache on the server side that cannot be reliably emptied. (But then, of course, Forms API's form cache is not emptied reliably either.)
Comments
Comment #1
Wim LeersThis will strongly affect
hierarchical_select_after_build()
and_hierarchical_select_submit()
.Comment #2
Wim LeersAnd it will remove the need to run
_hierarchical_select_form_has_hierarchical_select()
, which severely affected performance in some situations: #376159: _hierarchical_select_form_has_hierarchical_select() is expensive (and called from hook_form_alter()).Comment #3
Wim LeersI'm not entirely sure anymore why I chose to reconstruct the entire form before rendering just the necessary HS form item. This is what makes HS slow on some node forms, because the node form itself is slow to reconstruct. Removing the need to reconstruct the entire form can speed things up *tremendously*.
Comment #4
Wim LeersComment #5
Wim LeersComment #6
Wim LeersThis is a performance feature.
Comment #7
Wim LeersAnd will not be for HS 3.0 for D6.
Comment #8
Flying Drupalist CreditAttribution: Flying Drupalist commentedHi, does this mean it'll be for D6 4.x or it won't be for D6 at all?
Comment #9
Wim LeersFor D6. More like 3.5. 4.0 will involve API changes.
3.1, 3.2: minor bugfix releases. This is just an optimization and will not change anything visibly.
Interested in writing this? Basically it will require either POSTing all required data or passing most or all of it via a GET request (i.e. via the Drupal path). Not sure if that will be sufficient though. We also have to keep the security implications in mind. If you want to do it, I'll outline what exactly you have to do. Should not be too hard.
Comment #10
digi24 CreditAttribution: digi24 commentedsubscribe
I made some measurements, and on my site the ajax call takes approx. 0.8 seconds and consumes a similiar ammount of memory like a regular page with views.
Comment #11
robby.smith CreditAttribution: robby.smith commentedsubscribing - +1 for performance upgrades =)
Comment #12
crea CreditAttribution: crea commentedSubscribing
Comment #13
inforeto CreditAttribution: inforeto commentedSubscribing
Comment #14
timl CreditAttribution: timl commentedsubscribing
following from memcache + HS issue: http://drupal.org/node/538022
Comment #15
nirad CreditAttribution: nirad commentedsubscribing.
Comment #16
gianfrasoft CreditAttribution: gianfrasoft commentedsubscribing
Comment #17
morbiD CreditAttribution: morbiD commentedSubscribing. Reply #3 seems relevant to my bug report: #984366: HS causes repetitions of drupal_set_message() and form_set_error() in other modules
Comment #18
neochief CreditAttribution: neochief commentedSubscribing.
Comment #19
Wim LeersTagging for HS4. Included in the HS4 roadmap: http://drupal.org/node/1052670.
Comment #20
klonosThis will happen in the 7.x branch.