axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksander Slominski <>
Subject Re: Timings for processing of small messages
Date Wed, 18 Apr 2001 19:49:54 GMT
Sam Ruby wrote:

> OK, I'll translate my question into english...was this with or without
> FixedLengthInputStream?

it was exactly following other test template (so it was without
FixedLengthInputStream) or otherwise i would be breaking test assumptions (or
comparing apples to oranges). i have put in FixedLengthInputStream as i started
looking on how to write keep-alive test but i did not finish it (it is working but no

> Yes, socket opening/closing is a lot of overhead.  My original intent of
> this test was to measure latency or response time to SOAP messages.  It
> would be easy enough to remove all client, socket, and other processing on
> the front end, and for that matter all non-parsing related backend and just
> compare parsers, but that is most definately NOT what I wanted to do.

i think it is very valuable to test for real situations but i think also that
keep-alive should be very typical in SOAP/HTTP usage...

> Bottom line: if the xml parsing is a big part of the overall equation, I
> want to optimize that component.  Otherwise, I want to optimize where the
> time is actually being spent.

i agree completely - so maybe conclusion from this test is to optimize network IO?
and then to look on XML parsing?

>             if (element.equals(match)) {
>               result = new String(ch, start, length);
>             }

it is doing exactly the same in XPP - cut and paste from

String param1Value = pp.readContent();

and if you check XML Pull Parser source code you can see new String(...) happening in

  public String readContent() throws XmlPullParserException {
    if(eventType != CONTENT)
      throw new XmlPullParserException("no content available to read");
    if(elContent == null) {
      if(tokenizer.parsedContent) {
        elContent = new String(tokenizer.pc, tokenizer.pcStart,
          tokenizer.pcEnd - tokenizer.pcStart);
      } else {
        elContent = new String(tokenizer.buf,
          tokenizer.posStart, tokenizer.posEnd - tokenizer.posStart);
    return elContent;

BTW: you make an assumption that SAX processor in characters() callback is giving you
whole element value in ch[] buffer (it is normally true if value is just number but
xerces will have multiple charcters() callbacks for each entity such as text with
&amp;  even though some SAX drivers may guarantee to give you one characters()
callback and that what is done in XPP/SAX you should not make SAX code depend on

so i think that SAX test should look like this:

public class SimpleSaxSoapServer
        StringBuffer resultBuf   = new StringBuffer();
        boolean matched;
        public void startElement(String uri, String localName, String qname,
                                Attributes atts) {
            element = localName;
            matched = element.equals(match) ;
            // ASSERT: there is only one match!
            // or otherwise necessary to reset resultBuf on each matched element or
signal error...
       public void characters(char[] ch, int start, int length) {
            if (matched) {
              resultBuf.append(new String(ch, start, length));

        public void endElement(String uri, String localName, String qname) {
            element = "";
            if(matched) {
result = resultBuf.toString();


Aleksander Slominski, LH 316, IU,
As I look afar I see neither cherry Nor tinted leaves Just a modest hut
on the coast In the dusk of Autumn nightfall - Fujiwara no Teika(1162-1241)

View raw message