General: Reduce cell caching overhead using dirty flag to ensure that cells are only rewritten to the cache if they have actually been changed

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@72227 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker
2011-04-25 14:25:53 +00:00
parent ff4daef39c
commit 5672f25ebf
9 changed files with 76 additions and 39 deletions
@@ -36,9 +36,12 @@
class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
private function _storeData() {
$this->_currentObject->detach();
if ($this->_currentCellIsDirty) {
$this->_currentObject->detach();
$this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject);
$this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject);
$this->_currentCellIsDirty = false;
}
$this->_currentObjectID = $this->_currentObject = null;
} // function _storeData()
@@ -58,6 +61,7 @@ class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjec
$this->_currentObjectID = $pCoord;
$this->_currentObject = $cell;
$this->_currentCellIsDirty = true;
return $cell;
} // function addCacheData()