Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] Performance problem with soaplite

Expand Messages
  • Dave Kimberley
    ... ($som- valueof( //GovTalkMessage/Body/DigitalMail/MessageBody/CodingNoticeP9 )) { ... I tried the loop statement as: for my $Employee
    Message 1 of 3 , Jun 10, 2003
      Byrne Reese wrote:
      > I would say... yes.
      > I think your client code could be improved by parsing out the array
      > once, and then looping over it. The way your client code is written,
      > each iteration of the loop will cause the entire XML document to be
      > parsed/traversed looking for the ith element. To remedy, try a loop
      > structure like this:
      > my $i++;
      > for my $Employee
      > $i++;
      > # Do stuff here
      > }
      > The primary difference here is that the array is constructed once when
      > the array is initialized, and then an iterator (or cursor) is simply
      > moved along the list nodes for each iteration. It should be more
      > efficient. If not, let me know...

      I tried the loop statement as:

      for my $Employee

      This means I get each Employee as a perl data structure rather than a
      SOM object so I then cannot use dataof or attr so I cannot access the
      attributes? The following code no longer works:

      > my $tax = $Employee->dataof('CodingUpdate/TaxCode');
      > $p9->{'TaxCode'} = tax_code_expand(trim($tax->value));
      > if ($p9->{'TaxCode'} =~ m/^(D0|NT)$/)
      > {
      > $p9->{'Week1Month1Indicator'} = 1;
      > }
      > else
      > {
      > $p9->{'Week1Month1Indicator'} = $tax->attr->{'Week1Month1Indicator'};

      I can use:

      my $p9->{'TaxCode'} = $Employee->{'CodingUpdate'} -> {'TaxCode');

      but I cannot access the Week1Month1Indicator attribute.

      The loop construct I had was the only one I could get to work that
      allowed me to access attributes.

      Any ideas how I can access attributes and get reasonable performance in
      parsing the loop?


    Your message has been successfully submitted and would be delivered to recipients shortly.