On a large client project the menu system hosed at about 200 menu links. There is a core patch in the process but by only showing parent menu items we can take the render time of our site from 40s to about 2s. The load time on the page is still about 20 seconds, but that's another day. I've included a form_alter which helps with this for now.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | diff.txt | 5.04 KB | vosechu |
| #19 | dmenu_admin.tar_.gz | 1.77 KB | vosechu |
| #16 | diff.txt | 5.45 KB | vosechu |
| #16 | dmenu_admin.tar_.gz | 1.93 KB | vosechu |
| #15 | Primary links.jpg | 46.41 KB | vosechu |
Comments
Comment #1
vosechu commentedInitial project upload
Comment #2
vosechu commentedComment #3
vosechu commentedRan this through coder and made a lot of the updates requested from the previous applicant. I'm also providing a patch so that it's hopefully easier to read.
Comment #4
vosechu commentedPer recommendation from claar I've wrapped some lines to make them readable. Also added a README.txt with a brief description.
Comment #5
vosechu commentedComparison of modules:
Searching for 'drupal menu admin' did not reveal anything that looked like this module. I suspect that people don't often run into this problem except in the enterprise. Even then, Views can be used to create directories but some people really want to use the menu admin to create blocks using menu block or nice menus so this makes that possible.
The reason this is a module instead of a core patch:
This module does alter the look of the stock menu admin in a way that may not be necessary for all but the largest sites. If it turns out that people love it then it seems like a great thing to add to core, but for now it seems necessary to make it opt-in.
Comment #6
vosechu commentedThis also includes a non-core implementation of http://drupal.org/node/936046.
Comment #7
vosechu commentedComment #8
vosechu commentedUgh, coworker pointed out a subtle bug that prevented fields from being switched into textfields. Also that hidden fields would never work for non-js users even though it renders way faster.
Comment #9
vosechu commentedYeah, probably just going to use this as my CVS account for a little while. Did a couple performance enhancements and made it feel a little more drupaly in my eyes.
Comment #10
avpadernoHello, and thank you for applying for a CVS account.
As per requirements, the motivation message should be expanded to contain more features of the proposed project. For themes, it should include also a screenshot of the theme, and (when possible) a link to a working demo site; for modules, it should include also a comparison with the existing solutions.
Comment #11
vosechu commentedKiamlaluno: Do I need to resubmit? I don't have access to edit my post.
Comment #12
grendzy commentedafaik you can post a revised / expanded motivation message in a comment.
Some further suggestions:
-- your post mentioned this module improved render times - how? which paths are affected? Why does it take 40 seconds to render a page previously?
-- Screenshots of webkit inspector showing before / after would be useful
-- +1 for comparison with existing solutions; if there are none explain that as well
(full disclosure: I work with vosechu)
Comment #13
grendzy commentedbrief code review:
-- doxygen for hooks is moving to a verb in present tense, e.g. "Implements hook_menu()." (see http://drupal.org/node/1354 )
-- in hook_menu, title shouldn't have t() function
-- The comment "Adds menu item fields to the node form." doesn't seem accurate. There should be no space between the docblock and function declaration.
-- dmenu_admin.module contains some trailing whitespace
-- Since drupal_add_js is called conditionally, I think it would be better to set $preprocess = FALSE.
Comment #14
avpaderno@vosechu: You can expand the motivation in a comment, as grendzy reported.
Comment #15
vosechu commentedExpanded motivation message:
Drupal's menu system is absolutely awesome at what it does, especially if you run it in a browser with a fast rendering engine like Webkit. But imagine if you will, a client that uses IE7 and loves to shove everything in the menu system; that table drag is starting to look pretty evil and your client keeps claiming their browser crashes when the hit the menu page!
Dmenu_admin reduces this burdon significantly by only displaying a few elements at a time so that the JS rendering engine has less to do. If you have over 1000 menu items in one list you should absolutely be using this module. If you have over 500 and your clients use IE (and actually use the menuing system I suppose) you should absolutely be using this module.
Dmenu_admin only does two things but they're very important. First, it uses textfields instead of select boxes which cuts down on page load time dramatically (http://drupal.org/node/936046). Secondly, it makes child elements of a menu item 'display: none;' until the expand link on the parent is clicked.
Comparison with other modules:
Not many people have run into this problem yet. Googling did not reveal any modules that do similar things. My guess is that the enterprise users that have run into this problem aren't releasing their modules.
How to use this module:
Turn it on with the Module admin or via drush. No settings are required to configure the module.
Stats:
Menu items: 1,506
Without dmenu_admin:
Load time (Drupal processing): 23 seconds
Render time (JS render/paint): 34 seconds
With dmenu_admin:
Load time (Drupal processing): 17 seconds
Render time (JS render/paint): 2 seconds
To see the admin in action check out 'Primary links.jpg'
To see the load/render times according to webkit check out the 'Load+Render*' jpgs.
Comment #16
vosechu commentedCode updated regarding Grendzy's comments.
Comment #17
vosechu commented@kiamlaluno, expanded message posted. I've not been able to get a review of this, is it just too difficult to test accurately do you think? Or maybe too low effect?
Comment #18
mikey_p commentedThis doesn't look quite right, it seems that there is a file missing or something, or the menu callback and links to it are incorrect (the menu item's 'page callback' doesn't exist).
Comment #19
vosechu commentedAugh, damnit, you're right. Vestigial function. Attaching new version without the extra hook_menu. I feel like this is getting close to core-patch sized at this point but I know it's not going into core for a lot of reasons. Maybe it's time to do the same thing to the taxonomy admin.
Comment #20
grendzy commentedI think this meets the CVS requirements. The concerns raised so far (in both the code and motivation) have been addressed.
Comment #21
zzolo commented@vosechu, thanks for the application and patience. I have approved you, but would like you to consider the following for this module:
You should be using l() here.
Please read the following resources to make sure you know how to use CVS and the specifics to the Drupal CVS infrastructure, as well as how to be a good module maintainer on Drupal.org. The Drupal community is very large and dynamic; we welcome you as a module maintainer and hope that you embrace and challenge the Drupal community and continue to contribute.
--
Note: Please be patient with the CVS application process. It is all done by volunteers. Our goal is not to be arbitrarily slow or meticulous. Our goal is to get you CVS access and ensure that you are and will become a more responsible Drupal contributor. For a quick reference on what I look for in a code review, please see this article, or read the handbook page on how to review for reference..
Comment #22
vosechu commentedThanks for the fix zzolo and the advice. I think you're right about integrating with a larger module but I appreciate the CVS account.
Comment #25
avpaderno