Performance: Remove Hierarchical Select's form cache and don't reconstruct the entire form anymore

Wim Leers - July 23, 2009 - 01:05
Project:Hierarchical Select
Version:6.x-3.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Wim Leers
Status:postponed
Issue tags:Performance
Description

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.)

#1

Wim Leers - July 23, 2009 - 01:06

This will strongly affect hierarchical_select_after_build() and _hierarchical_select_submit().

#2

Wim Leers - July 27, 2009 - 13:25

And 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()).

#3

Wim Leers - July 28, 2009 - 07:05
Title:Remove Hierarchical Select's form cache» Remove Hierarchical Select's form cache and don't reconstruct the entire form anymore

I'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*.

#4

Wim Leers - July 28, 2009 - 07:06
Title:Remove Hierarchical Select's form cache and don't reconstruct the entire form anymore» Performance: Remove Hierarchical Select's form cache and don't reconstruct the entire form anymore

#5

Wim Leers - July 29, 2009 - 20:04

#6

Wim Leers - July 29, 2009 - 20:05

This is a performance feature.

#7

Wim Leers - July 29, 2009 - 20:05
Status:active» postponed

And will not be for HS 3.0 for D6.

#8

Flying Drupalist - July 29, 2009 - 20:30

Hi, does this mean it'll be for D6 4.x or it won't be for D6 at all?

#9

Wim Leers - July 29, 2009 - 20:35

For 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.

#10

digi24 - November 22, 2009 - 14:51

subscribe

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.

 
 

Drupal is a registered trademark of Dries Buytaert.