Flex w/ AMF Returning results slowly

anosim

New Member
I think this is just a matter of fine tuning some different elements, but I'd like to know your take. I've got a Flex app, using the Flex 4 data services, communicating with Zend AMF services. One of the services returns all the results in a database using \[code\]SELECT * FROM table\[/code\] there are ~1200 rows (140KB package size).My problem is the response time, it's rage inducing. Total duration is always between 7-8 seconds. All but about 150ms of that is latency. I broke up the PHP to figure out exactly where the latency was and turns out \[code\]return $rows\[/code\] is eating up ~6.8sec latency. I can deal with 1-2sec, but when I start waiting around for 8sec I feel kinda dumb. I cross checked the query response speed directly from the database, and just like I was expecting the total query time is 45-60ms.PHP, this is basically just the generated Flex data service code, although in production it isn't the same:\[code\]public function getAllProject_entries() { $stmt = mysqli_prepare($this->connection, "SELECT u.* FROM $this->tablename u"); $this->throwExceptionOnError(); mysqli_stmt_execute($stmt); $this->throwExceptionOnError(); $rows = array(); mysqli_stmt_bind_result($stmt, $row->id, $row->field1, $row->field2, $row->field3, $row->field4, $row->field5, $row->field6, $row->field7, $row->field8, $row->field9, $row->field10, $row->field11, $row->field12, $row->field13, $row->field14, $row->field15, $row->field16, $row->field17, $row->field18, $row->field19); while (mysqli_stmt_fetch($stmt)) { $rows[] = $row; $row = new stdClass(); mysqli_stmt_bind_result($stmt, $row->id, $row->field1, $row->field2, $row->field3, $row->field4, $row->field5, $row->field6, $row->field7, $row->field8, $row->field9, $row->field10, $row->field11, $row->field12, $row->field13, $row->field14, $row->field15, $row->field16, $row->field17, $row->field18, $row->field19); } mysqli_stmt_free_result($stmt); mysqli_close($this->connection); return $rows; }\[/code\]Do you need to see the Flex code? I'm not exactly sure what to show...Is there something I'm entirely missing?
 
Back
Top