Forum Discussion

VTest's avatar
VTest
Occasional Contributor
11 years ago

Large xml parsing in groovy taking time

Hello Friends,
I have a xml which is of about 680 plus elements , as in below format

<Node1>
<Element1 Time1 = X Time2= Y/>
.
.
.
.
.
.
.
.
<Element689 Time1 = X Time2= Y/>
<Element690 Time1 = X Time2= Y/>
</NOde1>

I have to compare that Time1 and Time2 values are not overlaping with any other Times for each element, I wrote the scipt to get the xml holder and compare the values , but due to the large amount of records it is taking more than 2 hours to validate one xml. Any suggestions are invited for efficient way to bring down the processing time.

2 Replies

  • MartinSpamer's avatar
    MartinSpamer
    Frequent Contributor
    VTest wrote:

    I have to compare that Time1 and Time2 values are not overlaping with any other Times for each element, I wrote the scipt to get the xml holder and compare the values , but due to the large amount of records it is taking more than 2 hours to validate one xml. Any suggestions are invited for efficient way to bring down the processing time.


    It all depends on what algorithm you are using to detect collisions.
  • VTest's avatar
    VTest
    Occasional Contributor
    Thanks for the response,
    i am taking a time from each element at a time and passing to the function which compare through the entire xml again. Any efficient method would help.