Minor performance tweak to PHPTemp and DiscISAM caching
This commit is contained in:
parent
bdb8b50156
commit
125f39c745
|
@ -69,11 +69,11 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
|
||||||
$this->_currentObject->detach();
|
$this->_currentObject->detach();
|
||||||
|
|
||||||
fseek($this->_fileHandle,0,SEEK_END);
|
fseek($this->_fileHandle,0,SEEK_END);
|
||||||
$offset = ftell($this->_fileHandle);
|
|
||||||
fwrite($this->_fileHandle, serialize($this->_currentObject));
|
$this->_cellCache[$this->_currentObjectID] = array(
|
||||||
$this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset,
|
'ptr' => ftell($this->_fileHandle),
|
||||||
'sz' => ftell($this->_fileHandle) - $offset
|
'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
|
||||||
);
|
);
|
||||||
$this->_currentCellIsDirty = false;
|
$this->_currentCellIsDirty = false;
|
||||||
}
|
}
|
||||||
$this->_currentObjectID = $this->_currentObject = null;
|
$this->_currentObjectID = $this->_currentObject = null;
|
||||||
|
|
|
@ -61,11 +61,11 @@ class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_
|
||||||
$this->_currentObject->detach();
|
$this->_currentObject->detach();
|
||||||
|
|
||||||
fseek($this->_fileHandle,0,SEEK_END);
|
fseek($this->_fileHandle,0,SEEK_END);
|
||||||
$offset = ftell($this->_fileHandle);
|
|
||||||
fwrite($this->_fileHandle, serialize($this->_currentObject));
|
$this->_cellCache[$this->_currentObjectID] = array(
|
||||||
$this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset,
|
'ptr' => ftell($this->_fileHandle),
|
||||||
'sz' => ftell($this->_fileHandle) - $offset
|
'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
|
||||||
);
|
);
|
||||||
$this->_currentCellIsDirty = false;
|
$this->_currentCellIsDirty = false;
|
||||||
}
|
}
|
||||||
$this->_currentObjectID = $this->_currentObject = null;
|
$this->_currentObjectID = $this->_currentObject = null;
|
||||||
|
|
Loading…
Reference in New Issue