Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Performance of parsing XML?  RSS feed

 
greg norman
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a simple channel for my company's portal. Basicly the channel get job advertising from a companys's internal server via http call. Since the channel will get very high traffic, I hope it as thin as possible.
Background:
When user clicks the "serach" button, the channel will eat in 5-10 job feeds (as separate XML stream). A single feed can contain no job or 100 jobs. The feeds have to be assembled for transformation.
Solutions:
1. Concantenate the feeds using StringBuffer().
2. Parse the feeds and generate a now DOM.
Which is better considering the performance? Any other solutions?
Thanks
 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Greg
I have done something similar in the past. The biggest bottleneck to the performance is likely to be the speed of your connection to get the data from the various feeds rather than the time taken to parse the returned information.
A lot will depend upon the datathat you get back from the feeds. If all of the feeds are using a common DTD/Schema then it shouldn't be too difficult. JAXP now allows you to create and cache transformers which will at least means that you will only need to parse the XSLT once.
The best option I can suggest is that you try both methods and see what the performance is like but I would definitely cache the parsed output so that you don't need to go to the source of the feeds for each incoming client request. We added a feature that would cache the incoming feed and/or the generated content for a fixed period of time e.g 30 minutes or 24 hours depending upon the voltility of the source information.
HTH
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!