当使用下面的代码从When服务中检索对象时,我发现合并这几行代码后,速度减慢了大约.5s。
$getChildren = $OKMDocument->getChildren(array('token' => $token, 'path' => $path));
$fileArray = $getChildren->return;至
$fileArray = $OKMDocument->getChildren(array('token'=> $token, 'path' => $path))->return;有没有一种简单的方法来确定为什么这会导致这样的性能影响?
编辑:
它是本地托管的webservice服务。
$OKMAuth = new SoapClient('http://localhost:8080/OpenKM/services/OKMAuth?wsdl');
$OKMDocument = new SoapClient('http://localhost:8080/OpenKM/services/OKMDocument?wsdl');发布于 2013-01-30 04:05:11
有没有一种简单的方法来确定为什么这会导致这样的性能影响?
您要搜索的工具称为profiler。分析PHP应用程序的最常见方法是结合使用xdebug profiler和wincachegrind或kcachegrind (linux)之类的工具,这些工具可以帮助您调查程序流和执行时间。GUI将如下所示:

您应该开始阅读关于性能分析的xdebug documentation
https://stackoverflow.com/questions/14591117
复制相似问题