[PATCH] Allow smarter node creation based on visibility during createtree As I've brought up on the mailing list thread "High latency caused by full tree creation", there is a large amount of delay per LuCI request which is spent building the node tree in createtree(). Most nodes created aren't  needed for the view presented to the user and only serve to consume memory and CPU time during a page load.
[PATCH] Allow smarter node creation based on visibility during createtree
As I've brought up on the mailing list thread "High latency caused by full tree creation", there is a large amount of delay per LuCI request which is spent building the node tree in createtree(). Most nodes created aren't 
needed for the view presented to the user and only serve to consume memory and CPU time during a page load.

My idea is to provide an easy mechanism for index()ers to determine which needs to be created and what isn't. Due to the constraints of the standard LuCI web interface, this optimization needs to establish a few rules:

 * The page requested must have its node created
 * All parents of the page being requested must be created, so the children inherit the track
 * All the top-level nodes "Status", "System", "Services", "Network" (and others added by extensions) must be created in order to have their top-level tabs in the UI
 * All peers of second-level nodes need to be created as well for the same reason, to display their links on the subindexes 
                
To make this easy to implement in each controller, the attached patch adds an "inreq" field to each created node to indicate if it lies on the request path. To satisfy the "top level node" requirement, we always 
add the top level node, then check its inreq property if the top-level node is not "in request", then the controller can exit index() early.


git-svn-id: f7818b41aa164576329f806d7c3827e8a55298bb@7357 ab181a69-ba2e-0410-a84d-ff88ab4c47bc

zwhfly/openwrt-luci,phi-psi/luci,yeewang/openwrt-luci,phi-psi/luci,Canaan-Creative/luci,zwhfly/openwrt-luci,dtaht/cerowrt-luci-3.3,vhpham80/luci,zwhfly/openwrt-luci,dtaht/cerowrt-luci-3.3,dtaht/cerowrt-luci-3.3,Canaan-Creative/luci,phi-psi/luci,ch3n2k/luci,projectbismark/luci-bismark,ReclaimYourPrivacy/cloak-luci,projectbismark/luci-bismark,ReclaimYourPrivacy/cloak-luci,8devices/carambola2-luci,stephank/luci,saraedum/luci-packages-old,Canaan-Creative/luci,stephank/luci,gwlim/luci,Flexibity/luci,jschmidlapp/luci,ThingMesh/openwrt-luci,saraedum/luci-packages-old,ThingMesh/openwrt-luci,zwhfly/openwrt-luci,Flexibity/luci,zwhfly/openwrt-luci,ch3n2k/luci,vhpham80/luci,vhpham80/luci,yeewang/openwrt-luci,Canaan-Creative/luci,Flexibity/luci,jschmidlapp/luci,freifunk-gluon/luci,phi-psi/luci,8devices/carambola2-luci,freifunk-gluon/luci,eugenesan/openwrt-luci,phi-psi/luci,yeewang/openwrt-luci,ch3n2k/luci,dtaht/cerowrt-luci-3.3,ThingMesh/openwrt-luci,vhpham80/luci,ThingMesh/openwrt-luci,eugenesan/openwrt-luci,phi-psi/luci,saraedum/luci-packages-old,yeewang/openwrt-luci,ReclaimYourPrivacy/cloak-luci,saraedum/luci-packages-old,yeewang/openwrt-luci,freifunk-gluon/luci,vhpham80/luci,8devices/carambola2-luci,saraedum/luci-packages-old,projectbismark/luci-bismark,ReclaimYourPrivacy/cloak-luci,yeewang/openwrt-luci,eugenesan/openwrt-luci,ThingMesh/openwrt-luci,stephank/luci,jschmidlapp/luci,jschmidlapp/luci,jschmidlapp/luci,gwlim/luci,projectbismark/luci-bismark,freifunk-gluon/luci,zwhfly/openwrt-luci,jschmidlapp/luci,projectbismark/luci-bismark,Flexibity/luci,projectbismark/luci-bismark,eugenesan/openwrt-luci,ch3n2k/luci,ThingMesh/openwrt-luci,gwlim/luci,Flexibity/luci,zwhfly/openwrt-luci,8devices/carambola2-luci,freifunk-gluon/luci,gwlim/luci,ReclaimYourPrivacy/cloak-luci,freifunk-gluon/luci,projectbismark/luci-bismark,freifunk-gluon/luci,ReclaimYourPrivacy/cloak-luci,eugenesan/openwrt-luci,Flexibity/luci,stephank/luci,ch3n2k/luci,eugenesan/openwrt-luci,gwlim/luci,Canaan-Creative/luci,8devices/carambola2-luci,zwhfly/openwrt-luci,dtaht/cerowrt-luci-3.3,ch3n2k/luci,phi-psi/luci,projectbismark/luci-bismark,stephank/luci,ReclaimYourPrivacy/cloak-luci,dtaht/cerowrt-luci-3.3,8devices/carambola2-luci,Flexibity/luci,jschmidlapp/luci,freifunk-gluon/luci,Canaan-Creative/luci,ReclaimYourPrivacy/cloak-luci,stephank/luci,ch3n2k/luci,saraedum/luci-packages-old,gwlim/luci,yeewang/openwrt-luci,Canaan-Creative/luci,gwlim/luci,ThingMesh/openwrt-luci,Canaan-Creative/luci,saraedum/luci-packages-old,zwhfly/openwrt-luci,jschmidlapp/luci,eugenesan/openwrt-luci,vhpham80/luci,8devices/carambola2-luci,Flexibity/luci