aspose file tools*
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "An interview question" Watch "An interview question" New topic
Author

An interview question

Thillai Sakthi
Ranch Hand

Joined: Jun 17, 2000
Posts: 102
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...?
Thanks.


Regards,
Shakthi
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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.
Thanks.


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

Joined: Feb 27, 2002
Posts: 8919

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


Groovy
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
 
wood burning stoves
 
subject: An interview question