public function compare(Xhgui_Profile $head)
{
$this->calculateSelf();
$head->calculateSelf();
$keys = array_merge($this->_keys, $this->_exclusiveKeys);
$emptyData = array_fill_keys($keys, 0);
$diffPercent = array();
$diff = array();
foreach ($this->_collapsed as $key => $baseData) {
$headData = $head->get($key);
if (!$headData) {
$diff[$key] = $this->_diffKeys($emptyData, $baseData);
continue;
}
$diff[$key] = $this->_diffKeys($headData, $baseData);
if ($key === 'main()') {
$diffPercent[$key] = $this->_diffPercentKeys($headData, $baseData);
}
}
$diff['functionCount'] = $head->getFunctionCount() - $this->getFunctionCount();
$diffPercent['functionCount'] = $head->getFunctionCount() / $this->getFunctionCount();
return array('base' => $this, 'head' => $head, 'diff' => $diff, 'diffPercent' => $diffPercent);
}