jgp4 Posted June 11, 2008 Share Posted June 11, 2008 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. Link to comment https://forums.phpfreaks.com/topic/109697-performance-of-xml-parsing-vs-recursive-db-access-to-generate-menu/ Share on other sites More sharing options...
bluejay002 Posted June 11, 2008 Share Posted June 11, 2008 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. Link to comment https://forums.phpfreaks.com/topic/109697-performance-of-xml-parsing-vs-recursive-db-access-to-generate-menu/#findComment-562901 Share on other sites More sharing options...
jgp4 Posted June 11, 2008 Author Share Posted June 11, 2008 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. Link to comment https://forums.phpfreaks.com/topic/109697-performance-of-xml-parsing-vs-recursive-db-access-to-generate-menu/#findComment-562926 Share on other sites More sharing options...
bluejay002 Posted June 11, 2008 Share Posted June 11, 2008 okay... and if possible, post the result of your benchmark here so other fellas might also learn from it, including me :-). God bless! Link to comment https://forums.phpfreaks.com/topic/109697-performance-of-xml-parsing-vs-recursive-db-access-to-generate-menu/#findComment-562954 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.