From d9e02a5d0c1a81925df33a9b25501fc90db91451 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 16 Dec 2008 04:29:00 +0000 Subject: 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! --- core/libraries/ORM_MPTT.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/libraries') 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; } -- cgit v1.2.3