Amfphp is working slow with Flex-4
-
22-07-2021 - |
سؤال
Well, I am trying to use remote object (Amfphp) in a project which is using httpservice. I heard it will make my application faster. But when i tried Amfphp in a datagrid for testing purpose i found it takes even more time then httpservice. Here is what i have done so far.
AS-3 code to call php function:
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;
}
And the php function to fetch data from mysql database:
class output{
public $grid;
public $week;
}
function form()
{
$arrayOut = new output();
$arrayOut->grid = $this->gridValue();
$arrayOut->week= $this->getAllWeek($this->ThisYear);
return $arrayOut;
}
Everything works fine. But it takes almost 5 seconds to fetch and render 280 rows of data. Can anyone please help me make it as fast as it should ? I've already tried the optimization tips of silexlabs
I used packet sniffer and stats are the following. It says Latency is consuming most of the time about 5 sec. What's that latency? Need help guys. Please:
المحلول
Try to use amfphp 1.9
.
amfphp 2.x
version is unfortunately slower than 1.9