Hiya,
I’m working on Taxonomy 2.x at the moment and I’ve made the decision to store tree arrays much like the pages module does and load each tree into the current user’s session via the sessions_end extension hook.
My concern is that tree data is a lot heavier than just entry_id => template / entry_id => url
Here’s an array of a very simple tree with 3 nodes for example:
[taxonomy] => Array
(
[tree] => Array
(
[1] => Array
(
[label] => About Us
[tree_array] => Array
(
[0] => Array
(
[node_id] => 1
[lft] => 1
[rgt] => 6
[label] => Home
[entry_id] => 32
[template_path] => 0
[custom_url] => [page_uri]
[field_data] =>
[status] => open
[highlight] => 009933
[channel_id] => 1
[title] => Home
[url_title] => home
[entry_date] => 1303983262
[template_id] =>
[group_id] =>
[template_name] =>
[group_name] =>
[is_site_default] =>
[level] => 0
[has_children] => yes
[children] => Array
(
[0] => Array
(
[node_id] => 4
[lft] => 2
[rgt] => 3
[label] => Here's a page
[entry_id] => 81
[template_path] =>
[custom_url] => [page_uri]
[field_data] =>
[status] => open
[highlight] => 009933
[channel_id] => 1
[title] => Here's the about page
[url_title] => heres_the_about_page
[entry_date] => 1304564140
[template_id] =>
[group_id] =>
[template_name] =>
[group_name] =>
[is_site_default] =>
[level] => 1
)
[1] => Array
(
[node_id] => 5
[lft] => 4
[rgt] => 5
[label] => Here's another page
[entry_id] => 82
[template_path] =>
[custom_url] => [page_uri]
[field_data] =>
[status] => open
[highlight] => 009933
[channel_id] => 1
[title] => Here's the contact page
[url_title] => heres_the_contact_page
[entry_date] => 1304564185
[template_id] =>
[group_id] =>
[template_name] =>
[group_name] =>
[is_site_default] =>
[level] => 1
)
)
)
)
)
)
)Is this just stoopid? Should I not bother with this plan?
OK, I’ve done some testing on this based on feedback on Twitter from @gaker and @_rsan:
So loading EE out of the box, Taxonomy not enabled and just rendering a blank template:
MEMORY USAGE 861,300 bytes
Loading Time: Base Classes 0.0009
Controller Execution Time 0.0096
Total Execution Time 0.0107Enabling Taxonomy with the extension base64decoding and unserializing two trees into the user’s session array, (400 nodes and 200 nodes) + rendering a tree as an unordered list with 400 nodes using the exp:taxonomy:nav tag:
MEMORY USAGE 2,606,536 bytes
Loading Time: Base Classes 0.0010
Controller Execution Time 0.1059
Total Execution Time 0.1070Does this raise any eyebrows?
This is slightly off topic, but since you said you were working on Taxonomy 2.x I was wondering if you might consider a new feature that we are in need of. We have non technical editors (which is likely a common situation) and we are using Taxonomy for our navigation and general hierarchy. The issue becomes if our editors drag too many nodes to the root level, it would eventually break the design of the site. The feature request would be to have the ability to “lock down” certain node levels based on user groups to prevent this from happening.
Great job on Taxonomy BTW, I can tell you how many hours it has saved us already!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.