Re: Why does Barracuda choose the way to parse the whole page (*ML) to a doc?
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Xue-Feng, See comments below... At 11:39 AM 3/16/2003 -0500, you wrote: > > Barracuda, theoretically, deals > > with any DOM structure > > that implements the w3c dom. In practice, pretty > > much everyone uses XMLC > > and it is used by Barracuda's examples by default. > > So, Barracuda has > > little to say about the implementation of the dom > > structures except that it > > expects them to be w3c dom compliant. > > > >That is what I need to know. You answered it. Thank >you. > >I have conclusion now. I think get rid of w3c dom will >make the performance much better. However, Barracuda >cannot do this. So it will not perform well. I should be a bit more clear on this. The Barracuda *component* model expects a w3c compliant dom. The event model and the forms model are utterly disconnected from the component model (and from each other). Therefore, if you like the event framework, then use that and use whatever presentation strategy you like. If you use the Barracuda component model, at least as it stands currently, then you are going to deal with w3c dom. This doesn't prevent you from building your own component model. Use whatever strategy you like. That is the beauty of Barracuda. It doesn't tie you into any one presentation strategy. There are people that use JSP with Barracuda, although I can't fathom why? The basic point is, if you believe that the w3c dom is simply a dog in performance, then use something else. > > > > I still don't fully understand the "squeezing" that > > you speak of, so you > > are going to have to be a bit more clear on that. > >I am very clear about and use this idea a lot. Let me >make a bit clear here in the following toy example. > >Assume index.html an XHTML which has 1,000,000 w3c dom >Nodes there. It contains one dynamic data, remember it >just a toy. Then in my data tree, actually it a >3-nodes data line in this case. There are only three >nodes. Do you see the difference for parser >performance? Well, in a page that contains one dynamic data member, utilizing XMLC's LazyDOM won't automatically open all 1,000,000 nodes just to modify that one node. This is, of course, not the default behavior of most w3c compliant dom models. I think Xerces2 has one as well, but I'm unfamiliar with it. The DOM does have its caveats, but there are many people who have used it successfully with reasonable performance. The big draw of the DOM (and XMLC specifically) is allowing for the clean separation of *ML developers from the Java developers (and the fine-grained control the developer has over the DOM document). I assume your "sqeezing" strategy doesn't give that up, does it? If it does, then we are talking apples and oranges. Surely there presentation strategies that provide for better runtime performance than the dom, but most give up the clean separation that the dom provides in order to achieve the better performance. That's a deal breaker for me. BTW, do you have working software that implements your "squeezing" idea? Like I said above, you can use any presentation strategy you want. Barracuda's event model is more than compelling on its own. Use it, discard the rest, and implement a component model using your squeezing strategy. I'm sure people here would be interested in that. Contributions are always welcome. Jake >