简体   繁体   中英

How to speed up php simplexml

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?

好吧,您只需要解析一次XML,然后将解析的对象传递给每个函数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM