我正在尝试在一个使用httpservice的项目中使用远程对象(Amfphp)。我听说它会让我的应用程序更快。但是,当我出于测试目的在datagrid中尝试Amfphp时,我发现它比httpservice需要更多的时间。以下是我到目前为止所做的工作。
调用php函数的AS-3代码:
public function init():void{
var params:Array = new Array();
params.push("1234");
_amf = new RemoteObject;
_amf.destination = "dummyDestination";
_amf.endpoint = "http://insight2.ultralysis.com/Amfphp/Amfphp/";//http://insight2.ultralysis.com
_amf.source = "manager1";
_amf.addEventListener(ResultEvent.RESULT, handleResult);
_amf.addEventListener(FaultEvent.FAULT, handleFault);
_amf.init(params);
}
public function handleResult(event:ResultEvent):void{
myGrid.dataProvider = event.result.grid;
}以及从mysql数据库获取数据的php函数:
class output{
public $grid;
public $week;
}
function form()
{
$arrayOut = new output();
$arrayOut->grid = $this->gridValue();
$arrayOut->week= $this->getAllWeek($this->ThisYear);
return $arrayOut;}
一切都很好。但获取和呈现280行数据几乎需要5秒。有没有人能帮我把它做得尽可能快?我已经尝试过silexlabs的优化技巧
我使用了数据包嗅探器,数据如下。它说,延迟消耗了大约5秒的大部分时间。这个延迟是什么?需要帮助的人。请:

发布于 2013-02-25 21:49:58
尝试使用amfphp 1.9。
不幸的是,amfphp 2.x版本比1.9慢
https://stackoverflow.com/questions/13151363
复制相似问题