About Us
AxelJung Timo Schmidt
Software Developer Software Developer
AOE media GmbH AOE media GmbH
3.
Preparation
Install Virtualboxand import the t3dd2012 appliance (User &
Password: t3dd2012)
You will find:
• Apache with xdebug and apc
• Jmeter
• Kcachegrind
• PHPStorm
There are two vhost:
• typo3.t3dd2012 and playground.t3dd2012
Analyzing Cachegrinds
●High self/ medium self and
many calls =>
High potential for optimization
● Early in call graph & not needed =>
High potential for optimization
18.
Hands on
● Thereis an extension „slowstock“
in the VM.
● Open:
„http://typo3.t3dd2012/index.php?id=2“ and analyze it with kcachegrind.
Change 1 (SoapConversionRateProvider)
After:
/**@var SoapClient */
protected $converter;
/** @return void */
public function __construct() {
$this->converter = new SoapClient($this->wsdl);
}
/**
* @param string $fromCurrency
* @param string $toCurrency
* @return float
*/
public function getConversionRate($fromCurrency, $toCurrency) {
$in = new stdClass();
$in->FromCurrency = $fromCurrency;
$in->ToCurrency = $toCurrency;
$out = $this->converter->ConversionRate($in);
$result = $out->ConversionRateResult;
return $result;
}
24.
Total Time Cost10910560 ( ~ -15%)
11,99 % is still much time :(
25.
Change 2 (SoapConversionRateProvider)
● Conversion rates can be cached in APC cache to reduce webservice
calls.
– Inject
„ConversionRateCache“ into
SoapConversionRateProvider.
– Use the cache in the convert method.
26.
Change 2 (SoapConversionRateProvider)
Before:
/**@var SoapClient */
protected $converter;
/** @return void */
public function __construct() {
$this->converter = new SoapClient($this->wsdl);
}
/**
* @param string $fromCurrency
* @param string $toCurrency
* @return float
*/
public function getConversionRate($fromCurrency, $toCurrency) {
$in = new stdClass();
$in->FromCurrency = $fromCurrency;
$in->ToCurrency = $toCurrency;
$out = $this->converter->ConversionRate($in);
$result = $out->ConversionRateResult;
return $result;
}
Summary
● From 12769352 => 2877900 (-77%) with three changes
● Additional Ideas:
● Reduce created fluid objects by implementing static fluid view helpers
(examples in fluid core)
● Cache reverse conversion rate (1/rate)
● Use APC Cache Backend for TYPO3 and Extbase caches