You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Sanjiva Weerawarana <sa...@opensource.lk> on 2006/04/13 04:49:52 UTC

Re: [Axis2][Axiom]Always building Object Model .. no streaming at server response flow

Hi Srinath,

We've dealt with this already .. Axiom does *not* always build the
object model before sending .. what it does is pull and push. The writer
is responsible for turning off the tree building (caching) if the
message is not needed.

In any case, have you seen the recent performance numbers? I'd say we're
doing just fine. In your streaming scenario, is the XML you're trying to
stream out in Axiom? If not you have to pay the price of axiom-izing
(i.e., providing a stax reader). 

Sanjiva.

On Wed, 2006-04-12 at 16:19 -0400, Srinath Perera wrote:
> Hi Guys;
> 
> According to http://issues.apache.org/jira/browse/AXIS2-483 it sound
> like axiom always build the object model before sending out the
> message. (e.g. If nobody accsess the body, we should write the object
> diectly to output stream, no need to build the tree)
> 
> If that is the case there will be huge overhead.
> 
> Reporter of http://issues.apache.org/jira/browse/AXIS2-483 asked me
> about it. I do not have time to work on it. I do wan't at least try to
> help them. Can we call this a blocker for 1.0 release? It is a major
> bug IMO
> 
> thoughts?
> Srinath
> 
> --
> ============================
> Srinath Perera:
>    http://www.cs.indiana.edu/~hperera/
>    http://www.bloglines.com/blog/hemapani


Re: [Axis2][Axiom]Always building Object Model .. no streaming at server response flow

Posted by Srinath Perera <he...@gmail.com>.
> > Sorry, think I am mistaken, we talked about this lot and I thought it
> > is already implemented.
> >
>
> Its not a mistake. Hope you can remember that its you who removed that
> bit of code. :).
>
> Its called ObjectToOMBuilder which was used to register a SAXReader with
> an object and built OMElement out of it.

:) I remeber moving it out  .. I was under impression our data binding
impl incoperate the idea.

I will try to incoperate it when I get a chance.
Srinath



--
============================
Srinath Perera:
   http://www.cs.indiana.edu/~hperera/
   http://www.bloglines.com/blog/hemapani

Re: [Axis2][Axiom]Always building Object Model .. no streaming at server response flow

Posted by Eran Chinthaka <ch...@opensource.lk>.
Srinath Perera wrote:
>> 
> Sorry, think I am mistaken, we talked about this lot and I thought it
> is already implemented.
> 

Its not a mistake. Hope you can remember that its you who removed that
bit of code. :).

Its called ObjectToOMBuilder which was used to register a SAXReader with
an object and built OMElement out of it.

-- Chinthaka


Re: [Axis2][Axiom]Always building Object Model .. no streaming at server response flow

Posted by Srinath Perera <he...@gmail.com>.
> On Wed, 2006-04-12 at 23:08 -0400, Srinath Perera wrote:
> > yep numbers look good :)
> >
> > My senario is if Web Service return a object (Bean) it should be
> > written to the output stream without buiding OM. This may change if a
> > handlers accsess the body, but if they do not, OM should write them
> > out directly.
>
> This is not impossible but requires hacking: do we expect a specific
> method signature to write it or introduce an interface?
>
> If the performance is acceptable then why bother? Yes it should
> definitely lead to further perf improvement, but only in cases the
> payload is never read. I'm happy to special case this pattern, but it
> doesn't seem like a critical 1.0 feature to me because its really a
> fined tuned optimization and because it can be done without changing any
> current publicly visible APIs. (It may require the introduction of a new
> one (the interface saying "I can write directly") but AFAICT it does not
> require any change to whta we have now.)

This is a idea from axismora. We had this implemented in the M1
release in our simple data binding we had for testing. Those are the
days where talked about about 10X performance.

> > I am thinking about a fake OM Element ..which wrap a object ..  if
> > first accsess is a write, it is written to stream directly without
> > buiding a tree. We discussed lot about this .. I think we have this
> > implemented too.

> That said, if the code's done then why not I guess. Where is the code?

Sorry, think I am mistaken, we talked about this lot and I thought it
is already implemented.

> BTW your approach won't work .. what's needed is a dirty bit to remember
> whether the child of soap:Body has been read into OM. If not, if the
> that element has some flag saying its capable of direct write, then the
> sender would have to give the stax writer and ask it to write itself
> instead of asking for stax pull events and then writing those events.

What I had at M1 was a SAX builder, which when trigered(accessed)
build the whole Element. But if not accssed the SAX event source is
used to write the OMElement.

I agree this is not 1.0 feature .. so let's differ it. I will try to
dig out the code from M1 and if it is working we can discuss more

Thanks very much
Srinath
--
============================
Srinath Perera:
   http://www.cs.indiana.edu/~hperera/
   http://www.bloglines.com/blog/hemapani

Re: [Axis2][Axiom]Always building Object Model .. no streaming at server response flow

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Wed, 2006-04-12 at 23:08 -0400, Srinath Perera wrote:
> yep numbers look good :)
> 
> My senario is if Web Service return a object (Bean) it should be
> written to the output stream without buiding OM. This may change if a
> handlers accsess the body, but if they do not, OM should write them
> out directly.

This is not impossible but requires hacking: do we expect a specific
method signature to write it or introduce an interface? 

If the performance is acceptable then why bother? Yes it should
definitely lead to further perf improvement, but only in cases the
payload is never read. I'm happy to special case this pattern, but it
doesn't seem like a critical 1.0 feature to me because its really a
fined tuned optimization and because it can be done without changing any
current publicly visible APIs. (It may require the introduction of a new
one (the interface saying "I can write directly") but AFAICT it does not
require any change to whta we have now.)

> I am thinking about a fake OM Element ..which wrap a object ..  if
> first accsess is a write, it is written to stream directly without
> buiding a tree. We discussed lot about this .. I think we have this
> implemented too.

That said, if the code's done then why not I guess. Where is the code?

BTW your approach won't work .. what's needed is a dirty bit to remember
whether the child of soap:Body has been read into OM. If not, if the
that element has some flag saying its capable of direct write, then the
sender would have to give the stax writer and ask it to write itself
instead of asking for stax pull events and then writing those events.

Sanjiva.


Re: [Axis2][Axiom]Always building Object Model .. no streaming at server response flow

Posted by Srinath Perera <he...@gmail.com>.
yep numbers look good :)

My senario is if Web Service return a object (Bean) it should be
written to the output stream without buiding OM. This may change if a
handlers accsess the body, but if they do not, OM should write them
out directly.

I am thinking about a fake OM Element ..which wrap a object ..  if
first accsess is a write, it is written to stream directly without
buiding a tree. We discussed lot about this .. I think we have this
implemented too.

I do not know much about the
http://issues.apache.org/jira/browse/AXIS2-483, expect that I helpd
them to add the attachment.  May be
http://issues.apache.org/jira/browse/AXIS2-483 is fixed already (I did
not try it).. lets wait for reporters to get back ..

Thanks very much
Srinath

On 4/12/06, Sanjiva Weerawarana <sa...@opensource.lk> wrote:
> Hi Srinath,
>
> We've dealt with this already .. Axiom does *not* always build the
> object model before sending .. what it does is pull and push. The writer
> is responsible for turning off the tree building (caching) if the
> message is not needed.
>
> In any case, have you seen the recent performance numbers? I'd say we're
> doing just fine. In your streaming scenario, is the XML you're trying to
> stream out in Axiom? If not you have to pay the price of axiom-izing
> (i.e., providing a stax reader).
>
> Sanjiva.
>
> On Wed, 2006-04-12 at 16:19 -0400, Srinath Perera wrote:
> > Hi Guys;
> >
> > According to http://issues.apache.org/jira/browse/AXIS2-483 it sound
> > like axiom always build the object model before sending out the
> > message. (e.g. If nobody accsess the body, we should write the object
> > diectly to output stream, no need to build the tree)
> >
> > If that is the case there will be huge overhead.
> >
> > Reporter of http://issues.apache.org/jira/browse/AXIS2-483 asked me
> > about it. I do not have time to work on it. I do wan't at least try to
> > help them. Can we call this a blocker for 1.0 release? It is a major
> > bug IMO
> >
> > thoughts?
> > Srinath
> >
> > --
> > ============================
> > Srinath Perera:
> >    http://www.cs.indiana.edu/~hperera/
> >    http://www.bloglines.com/blog/hemapani
>
>


--
============================
Srinath Perera:
   http://www.cs.indiana.edu/~hperera/
   http://www.bloglines.com/blog/hemapani

RE: [Axis2][Axiom]Always building Object Model .. no streaming atserver response flow

Posted by Lakshmi Chaparala <la...@issinc.com>.
Hi Sanjiva,

We did try to turn off the tree building (caching) and the response just
hung.  This scenario is included in the JUnit test of the PTR. If you can
just take a look at the junit and see if something's wrong with what we did,
would really appreciate your advice on how to fix it on our side.  

Lakshmi

-----Original Message-----
From: Sanjiva Weerawarana [mailto:sanjiva@opensource.lk] 
Sent: Wednesday, April 12, 2006 8:50 PM
To: axis-dev@ws.apache.org
Cc: commons-dev@ws.apache.org; Lakshmi Chaparala
Subject: Re: [Axis2][Axiom]Always building Object Model .. no streaming
atserver response flow

Hi Srinath,

We've dealt with this already .. Axiom does *not* always build the
object model before sending .. what it does is pull and push. The writer
is responsible for turning off the tree building (caching) if the
message is not needed.

In any case, have you seen the recent performance numbers? I'd say we're
doing just fine. In your streaming scenario, is the XML you're trying to
stream out in Axiom? If not you have to pay the price of axiom-izing
(i.e., providing a stax reader). 

Sanjiva.

On Wed, 2006-04-12 at 16:19 -0400, Srinath Perera wrote:
> Hi Guys;
> 
> According to http://issues.apache.org/jira/browse/AXIS2-483 it sound
> like axiom always build the object model before sending out the
> message. (e.g. If nobody accsess the body, we should write the object
> diectly to output stream, no need to build the tree)
> 
> If that is the case there will be huge overhead.
> 
> Reporter of http://issues.apache.org/jira/browse/AXIS2-483 asked me
> about it. I do not have time to work on it. I do wan't at least try to
> help them. Can we call this a blocker for 1.0 release? It is a major
> bug IMO
> 
> thoughts?
> Srinath
> 
> --
> ============================
> Srinath Perera:
>    http://www.cs.indiana.edu/~hperera/
>    http://www.bloglines.com/blog/hemapani