Forum Discussion

g_kucharski's avatar
g_kucharski
Occasional Contributor
11 years ago

Extremly slow Array proccessing (VBS)

Hi,

writting a VBS to test .net app based on Janus GridEx.



I managed to get data from two GridExes into two different Arrays. Now I want to compare the data.




For i = Lbound(ArrNew,1) to Ubound(ArrNew,1)



   For k = Lbound(ArrNew,2) to Ubound(ArrNew,2)



      newV = ArrNew(i,k)



      refV = ArrRef(i,k)



      log.Message newV



      log.Message refV



   next



next



 


The arrays are about (5,6) filled with decimal numbers. TC fails to proccess them - I get a minute lag when moving to next records and the test timeouts. Does TC has a performance issue with arrays or am I doing sth terribly wrong?




42,577185                      17:56:13 Normal  

42,577185                      17:56:13 Normal 

29,511006                      17:56:14 Normal  

29,511006                      17:56:14 Normal  

VBScript runtime error.   17:57:14 Normal  



This operation was canceled because the method invoke timeout has expired.

Error location:

Unit: "VBS_GEN1\VBS_1\Script\Estimate"

Line: 324 Column: 7.



regards


4 Replies

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    Try this and see if it has problems...




    For i = Lbound(ArrNew,1) to Ubound(ArrNew,1)



       For k = Lbound(ArrNew,2) to Ubound(ArrNew,2)



          newV = ArrNew(i,k)



          refV = ArrRef(i,k)



          'log.Message newV



          'log.Message refV



       next



    next


  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    Well you have to take into account that the log is generating html and other data. Also (assuming my bad math is correct) you would have had about 31,250 messages written to the log which would cause...issues :). Anyhow I'm glad that worked for you, take care!
  • g_kucharski's avatar
    g_kucharski
    Occasional Contributor
    Thanks, it works without log.message lines.



    It seems that TC has some issue with fast proccessing of log commands, because the following variant also works:




    For i = Lbound(ArrNew,1) to Ubound(ArrNew,1)



      For k = Lbound(ArrNew,2) to Ubound(ArrNew,2)



        newV = ArrNew(i,k)



        refV = ArrRef(i,k)



        log.Message newV



        log.Message refV



        delay(50)



      next



    next



     


  • g_kucharski's avatar
    g_kucharski
    Occasional Contributor
    IK, found it. I DID sth terribly wrong.



    On different loop, which populated the arrays instead using



    arr(k,j) = some value



    I used



    Set arr(k,j) = some value



    results were disasterous for the performance...