tags:

views:

82

answers:

1

I have some code that utilizes simplexml to retrieve some data.

I perform about 4 functions that each use simplexml, per entry in a database. So if i have 4 entries in the database, im running simplexml 16 times to load that content.

Problem is that it takes about a quarter of a second or so to load each item, so as the page loads, it trickles in and takes a second or two to load the entire page.

Is there anyway to easily speed this up, or cash this, or some better way of watching my page expand with content each time it loads?

+2  A: 

Well, you only need to parse the XML once, and pass the parsed object to each of your functions.

JW
the information retrieved, is different for each entry, but i could try to lean it out if im using the same file per entry. Thanks for the input!
Patrick
I meant parse it once per database entry, no matter how many functions you're going to call on that entry. But maybe I misunderstood the problem.
JW