0

Console vs Button on Click using Mac App.

Technically .. what is the difference when running logic from the console vs running logic from the Button On Click event in the Mac App? 

I have a global function that reads 7,000+ rows in order .. and then builds a summary table of a few dozen rows from the for loop. 

 

When I call the global function from the console the for loop processes 7,000+ rows and builds a few dozen summary rows in about 4 seconds.   

 

When I call the global function from within the Button On click... well.. it is still running after about 5+ minutes. 

8 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    Could it be that the script behind a button is executed locally and script via the console, on the server?

    can you execute your code in the button forced to be executed on the server and check the difference?(do as server...)

    • Mconneen
    • 4 yrs ago
    • Reported - view

    @Steven

    I thought the same... When I pull the code in locally to the button .. and wrap it in a do as server... NOTHING happens.. It is as if the script does not even execute.   So.. I am off to build it step by step to see where the down fall is.. :( 

    • Mconneen
    • 4 yrs ago
    • Reported - view

    Hmm.. So this code finishes..   There are 3500+ rows.. not 7,000.. 

    code1

    msg1

    If I add one more if / else... code runs .. and runs.. and I eventually kill it after 5+ minutes..

    code2

     

    If I wrap it in a do as server... the do as server code block never executes. 

    code3

    msg2

    • Mconneen
    • 4 yrs ago
    • Reported - view

    The one additional if / then / else.. 32+ minutes via Mac App / button logic. 

    fubar

    • Sean
    • 4 yrs ago
    • Reported - view

    @Mconneen, What's the performance like if you run the process with the data stored on your local computer?

    • Mconneen
    • 4 yrs ago
    • Reported - view

    Here is the local (My Databases) performance of the code behind the button.. 

    msg3

    And if I run it from the console.. 

    msg4

    • Mconneen
    • 4 yrs ago
    • Reported - view

    And this is the console time running from Mac App against ninox cloud database

    msg4

    • Mconneen
    • 4 yrs ago
    • Reported - view

    Folks.. just an update.. So.. I have a "Dashboard" table.. that has "views" of other tables / data.   Running logic against one of those base tables from the Dashboard table is where the slow down is.   I changed my strategy to "openRecord" against the other base table.. and put a button on that table .. and POOF.. runs quick.  :( 

Content aside

  • 4 yrs agoLast active
  • 8Replies
  • 1716Views