This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes An interview question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "An interview question" Watch "An interview question" New topic

An interview question

Thillai Sakthi
Ranch Hand

Joined: Jun 17, 2000
Posts: 103
I was asked in an interview:
What could be the performance bottlenecks that could arise in SAX parsing?
I could not think of any..
Could any one help...?

Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
I can't really think of performance bottlenecks which apply for SAX but not DOM -- of course, bad code is bad code so a programmer could cause performance bottlenecks with both DOM and SAX.
However, I do know that your display name does not comply with our naming policy so I'll have to ask you to change it.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

SAX performs better than DOM. I dont see any bottle necks here.
Ofcourse programmer must write good code.
You can also see new StAX API which is pull based API and can also be used to create XML document unlike SAX

Tony Yan
Ranch Hand

Joined: Apr 10, 2002
Posts: 170
If there are bottlenecks in SAX parsing, they will be in the handlers. Therefore, there are no bottlenecks in principle for SAX, but possibly bad codes caused by the handlers.

Tony Yan<br /> <br />IBM Certified Developer XML and Related Technology<br />Sun Certified Web Component Developer For J2EE Platform<br />Sun Certified Programmer For Java 2 Platform
I agree. Here's the link:
subject: An interview question
jQuery in Action, 3rd edition