summaryrefslogtreecommitdiff
path: root/core/libraries
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-16 04:29:00 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-16 04:29:00 +0000
commitd9e02a5d0c1a81925df33a9b25501fc90db91451 (patch)
treea10bc2a56861cd1c1adb2241d8e877ba12fcd2ae /core/libraries
parentdc089173456c95dcec1e6184b8e6b5b2810ced52 (diff)
Various optimizations:
o Add model_cache::get() which caches models avoiding duplicate lookups o Stop using ORM relationships for Item_Model::owner so that we can use caching o For Item_Model::xxx_edit fields, don't make them editable for guests o Other minor stuff. These optimizations reduce the number of queries for a 9-photos page from ~200 to ~45. Still way too many!
Diffstat (limited to 'core/libraries')
-rw-r--r--core/libraries/ORM_MPTT.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/libraries/ORM_MPTT.php b/core/libraries/ORM_MPTT.php
index 411afe44..37789156 100644
--- a/core/libraries/ORM_MPTT.php
+++ b/core/libraries/ORM_MPTT.php
@@ -114,8 +114,7 @@ class ORM_MPTT_Core extends ORM {
*/
function parent() {
if (!isset($this->parent)) {
- $this->parent =
- ORM::factory($this->model_name)->where("id", $this->parent_id)->find();
+ $this->parent = model_cache::get($this->model_name, $this->parent_id);
}
return $this->parent;
}