Forum Discussion

rdebie's avatar
17 years ago

getNodeValue is verry slow (10 seconds)

When i ask a value from a node it takes 10 seconds before i got an answer.

I have a large response and i use the follow syntax.

JiraKey = holder.getNodeValue(//multiRef[" + Counter + "]/key)

How can i speed up this syntax?

because i use this syntax in a loop and it taker 1:30 hours to get 500 nodeValues from a response.

I use a jira filter that gave me 500 Jira Issues. 500 Jira issues is for what we are doing normal. The most filters that we user give a result about 1000 jira issues.

4 Replies

  • omatzura's avatar
    Super Contributor

    hmm.. can you show the entire script?


  • import java.util.*

    def ArrayList TotJiraIssue = new ArrayList();
    def ArrayList Items = new ArrayList();
    def ArrayList IssueIDs = new ArrayList();
    def ArrayList IssueKeys = new ArrayList();

    def groovyUtils = new context )
    def holder = groovyUtils.getXmlHolder( "Ophalen Issue mbv FilterID#response" )

    TotJiraIssue = holder.getNodeValues( "//getIssuesFromFilterReturn")
    Items = holder.getNodeValues( "//multiRef")

    Teller = 1
    IssueTeller = 0"Aantal Issue ophalen : " + TotJiraIssue.size -1)
    while (Teller <= Items.size)
      IssueKey = holder.getNodeValue("//multiRef[" + Teller + "]/key")
      if (IssueKey != null)
          IssueID = holder.getNodeValue("//multiRef[" + Teller + "]/id")

"Aantal valide issues gevonden : " + IssueTeller)


      if (IssueTeller == (TotJiraIssue.size)-1)

    context.IssueTeller = 0;
    context.IssueIDs = IssueIDs;
    context.IssueKeys = IssueKeys;
  • omatzura's avatar
    Super Contributor

    thanks.. performing a //XXX selection will take time on a large document since all nodes will have to be searched each time. Maybe you could "narrow the selection" by specifying all parent elements? ie


    (or whatever prefix you soap envelope has)..

    If that doesn't help significantly, please mail me a sample response you are selecting from so I can try to optimize this locally.. (


  • That did not solf the problem.
    Ik can only speed up, when i write the response to a file an than, walk thru
    the file. Monday i wil mail you the export of the respnse.