Speed issue with simplexml - XML files referencing other XML files



I hope this is clear - I tried searching for questions related to speed and simplexml, but didn't find anything that quite matches my problem:


I am writing a search function - the search itself returns an XML file (example: http://ift.tt/1xsQYM4)


This file is read using curl. Now, for each item in this XML file, there is a reference to ANOTHER XML file which contains metadata for that item. So if my search yields 200 results, I have to open 200 additional XML files using curl and parse them using simplexml to display info such as author, publishing year etc.


I did some speed testing on my script (which currently uses around 80 seconds if I limit the number of hits to max. 500), and found that this simplexml opening of files is eating 80% of the execution time.


Does anybody have suggestions as to how I can speed up this, or do you need further clarifications?


Best regards from Oslo, Norway


No comments:

Post a Comment