mysql - How to free memory at end of PHP script to make my database insertion script faster for the next request? -


i have php script reads contents of xml file , creates object using

$xml = new simplexmlelement($file_name, 0, true); 

it converts object workable array , loops through array , saves data database. i've noticed when using script on , on again, thought xml files same size script takes longer , longer.

do need free memory, or there practices can when i've reached end of memory intensive script?

first thing i'd check database structure. might need drop/add indexes in database tables. stuff slowing down because database slowing down, exposing weak spots in database.

you need metric script. echo out time before , after database queries. check how time spent individually , in total , how on lines containing queries.

so @ beginning , end of script , before , after query lines , do:

echo microtime(), "<br />\n"; 

if not problem (and surprise me), can check if perhaps storing data (for example) session or so.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -