diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-08-12 11:05:59 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-08-12 11:05:59 +0000 |
commit | 0cb07428181f485ce666ad55a528d6a831b062a7 (patch) | |
tree | 0295e559899dffe75a8798ff480bf87676f98a1a /libs/json | |
parent | b3861e0ec70ad94f925f196564e6a20e509ab9c4 (diff) |
[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.
Diffstat (limited to 'libs/json')
0 files changed, 0 insertions, 0 deletions