Jump to content

Performance of XML parsing vs recursive db access to generate menu


jgp4

Recommended Posts

Hi,

 

I'm redeveloping a CMS at work which in the past ran solely from a mysql db, however to improve performance the new system will generate static content when a page is created/editing in the admin.

 

The main thing I've yet to decide how to do is the menu generation code for the front end. In the past the system did a standard recursive function getting all pages which are children of the current page from the database.

 

What I was thinking about doing was, at the same time changes are made in the admin, generate an XML file which represents the sitemap of the site and rather than doing a lot of db access when drawing the menu, parse the XML file with simpleXML.

 

Does anyone have any idea how the two methods may compare performance wise?

 

Thanks in advance.

i think it depends on:

 

1. the amount of queries and the time it takes to make those query to return a result

    vs the file size of an xml file (if its stored in a file that is)

2. the frequency of changing the info

 

fair enough, for large queries... as in very ling-running queries... i generate an xml for it (given it changes less over time) and get data from xml... since its a lot faster that way.

Thanks bluejay,

 

I'm not sure how big any of the sites the CMS will be running on may get - we currently have some which are only about 30 or 40 pages, but we also have others which are hundreds, so I think I may have to do some benchmarking on it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.