AnsweredAssumed Answered

PHP API very slow

Question asked by LawrenceWard on May 26, 2009
Latest reply on Oct 2, 2009 by FluffyBear

Title

PHP API very slow

Your post

my employer has recently started to look to Filemaker as a solution to all his problems. my specific task in all this is to create some PHP intergration of other lagacy systems, as well as a presentation platform for entities that need no access to bussiness logic and data.

 

all is fine and i have not had too much trouble to learn how the API works. except that i have seen that it becomes extremely slow with even the smallest queries.

 

for example, to just get the count of a findall query for about 5000 records takes more than 10 seconds(on the localhost!)

inserting those records from a CSV file through PHP took longer than 10 minutes.

performing the same tasks with MySQL/PHP will take less than a 20 seconds on the same machine.

 

now maybe im not quite up to date on how to use filemaker effectively, but this is just absurd.

 

 

ini_set("memory_limit","64M");

// some initializing code here....

      function getrecordcount($table){      global $fm;      $result = $fm->newFindAllCommand($table)->execute();      if(!FileMaker::isError($result))           return $result->getFetchCount();      return 0;      }       echo getrecordcount('INVOICE').' records in INVOICE<br>'; echo getrecordcount('AGENT').' records in AGENT<br>'; echo getrecordcount('PRODUCT').' records in PRODUCT<br>'; echo getrecordcount('CONTAINER').' records in CONTAINER<br>'; echo getrecordcount('CONSIGNMENT').' records in CONSIGNMENT<br>'; echo getrecordcount('SALE').' records in SALE<br>';      

 

 oh, and as you can see i had to manually override php's memory limit to the script, otherwise it finishes with a FATAL error.

 

please, any GURU, enlighten me about whats going on here....

 

Outcomes