In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1319 [In-Portal CMS] Front End bug report always 2012-06-11 08:42 2012-07-25 05:29
alex  
alex  
normal  
closed 5.0.0  
fixed  
 
none 5.2.0  
https://groups.google.com/d/topic/in-portal-bugs/03AJylZfXa8/discussion
Improves speed of menu cache rebuild on large category counts
1
0001319: Unable to use <inp2:st_CachedMenu on large (over 4000) category count (while only 20 in menu)
Main difference between current In-Portal 5.x and In-Portal 4.3.9 is integrated In-Edit module.

This allowed to have more control over CMS part of In-Portal and provided huge possibilities such as:
* content revision tracking
* browse mode
* drag-n-drop support of theme elements
* almost inline phrase editing right inside a theme

To get that we needed to create a category for each template file in each theme, that is used on a website. We actually store ALL 4000 categories in cache (and not only these 20, which are usually in menu) to solve problem when you call st_CachedMenu tag with category_id parameter, which isn't in menu, but all it's child categories are.

That's why we cache ALL categories and then only display ones, that have IsMenu mark.

There might be more elegant solution, like this:
1. get all categories, that have IsMenu (usually no much)
2. get ParentPath of all categories, that were selected on previous set
3. create multi-dimensional array where we'll have all IsMenu categories to be displayed grouped by their parent categories
4. some categories will only have 1 child category because one of it's children have IsMenu categories, but category on it's own isn't displayed in menu.

Sounds pretty interesting optimization. Would speed up menu cache building (if you have many categories) very much.
patch menu_cache_rebuild_optimization.patch (11,596) 2012-07-02 08:46
http://tracker.in-portal.org/file_download.php?file_id=1720&type=bug
Issue History
2012-07-25 05:29 alex Note Added: 0004848
2012-07-25 05:29 alex Status resolved => closed
2012-07-03 08:20 Dmitry Target Version Icebox => 5.2.0
2012-07-02 08:48 alex Note Added: 0004751
2012-07-02 08:48 alex Status reviewed and tested => resolved
2012-07-02 08:48 alex Fixed in Version => 5.2.0
2012-07-02 08:48 alex Resolution open => fixed
2012-07-02 08:48 alex Assigned To !COMMUNITY => alex
2012-07-02 08:48 alex Changeset attached 5.2.x r15422
2012-07-02 08:47 alex Note Added: 0004750
2012-07-02 08:47 alex Status needs testing => reviewed and tested
2012-07-02 08:47 alex Note Added: 0004749
2012-07-02 08:46 alex Assigned To => !COMMUNITY
2012-07-02 08:46 alex Developer => alex
2012-07-02 08:46 alex Status active => needs testing
2012-07-02 08:46 alex File Added: menu_cache_rebuild_optimization.patch
2012-06-11 08:44 alex Reference => https://groups.google.com/d/topic/in-portal-bugs/03AJylZfXa8/discussion
2012-06-11 08:42 alex New Issue
2012-06-11 08:42 alex Change Log Message => Improves speed of menu cache rebuild on large category counts
2012-06-11 08:42 alex Estimate Points => 1

Notes
(0004749)
alex   
2012-07-02 08:47   
I've did some benchmark of new and old ways of menu cache building. Here are measurements for test case, when 10 categories of 4000 are in menu:

Before:
* Cache building time: 4 seconds
* Data amount in cache: 2MB

After:
* Cache building time: 0.05 seconds
* Data amount in cache: 7KB
(0004750)
alex   
2012-07-02 08:47   
Will test all together later.
(0004751)
alex   
2012-07-02 08:48   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001319: Unable to use <inp2:st_CachedMenu on large (over 4000) category count (while only 20 in menu)
(0004848)
alex   
2012-07-25 05:29   
Since 5.2.0 version was released.