Skip navigation
2144 Views 10 Replies Latest reply: Apr 26, 2012 10:39 PM by AshishSharma RSS
AshishSharma Bronze 50 posts since
Jan 10, 2011
Currently Being Moderated

Feb 9, 2012 1:18 AM

GetValue works slow in a complex and bulky sheet..

Hello all,

  

GetValue function is working as expected when I read simple to medium complex worksheet in my external java program but its taking around 3-4sec for every GetValue when I read some bulky and complex worksheet like 15MB in size (I checked both save/do not save large results in xml but result is same). I can not post the worksheet here due to IP issues.

 

Its quite annoying when sheet has 100s of variables in it. Moreover it hangs for indefinite time at GetValue of any random variable. The more confusion in that the variable while getting value of which application hung last time gives value next time.

 

Any suggesions that I can make it work and faster?

 

Thanks & Regards,

Ashish

  • A.Non Diamond 10,396 posts since
    May 11, 2010

    GetValue function is working as expected when I read simple to medium complex worksheet in my external java program but its taking around 3-4sec for every GetValue when I read some bulky and complex worksheet like 15MB in size (I checked both save/do not save large results in xml but result is same).

    How long does it take the worksheet to calculate? You can't possibly get the values faster than that, and in practice there will of course also be some overhead.

     

    I assume you are only loading the worksheet once, and then getting all the values!

     

     

    Moreover it hangs for indefinite time at GetValue of any random variable. The more confusion in that the variable while getting value of which application hung last time gives value next time.

    When you say it hangs for an indefintie time do you mean it eventually recovers, or does it never give you the value? This sounds like a bug to me.

      • A.Non Diamond 10,396 posts since
        May 11, 2010

        Its taking around 5sec approx to calculate the worksheet. So do you mean to say the worksheet is implicitly recalculated each time I call GetValue?

        No, that's not what I meant. I meant only that if it takes, for example, 10 minutes, to calculate the entire worksheet, then it will take that long to get a variable at the end of the sheet, and maybe even at the beginning. I really hope it is not recalculating the entire sheet for every GetValue, and I don't think that is the case! You cold test that though. Put a very long calculation (for example a loop that executes millions of times)  at the start of the sheet, and see what happens to the timings.

         

         

        No, it does not recovers.

        That has to be a bug then. There's no good reason I can think of what GetValue would not work with a random number.

  • jsheehan PTCEmployee 91 posts since
    Jun 1, 2007

    Ashish

    What version are you on? There were memory leaks in versions of Mathcad 14 which showed themselves through the automation interfaces (GetValue).

    John

  • MichaelH Silver 150 posts since
    Jun 25, 2007

    Why don't you just pack an array in Mathcad with all the values and then just pass the array to the script using an input variable?

     

    The process can be reversed using an output variable to get the array out if necessary.

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 3 points
  • Helpful Answers - 1 points