Change in update mode calulated table between 18.2 and 19.0

Change in update mode calulated table between 18.2 and 19.0

patrick_zweekhorst
Advocate Advocate
11 Views
4 Replies
Message 1 of 5

Change in update mode calulated table between 18.2 and 19.0

patrick_zweekhorst
Advocate
Advocate

[ FlexSim 19.0.2 ]

Hi,

I updated a model from 18.2 to 19.0 and noticed that is was much slower in 19.0. After a little bit of searching I found that there is a difference in when the calculated table with update mode always is updated.
In my model I have a calculated table that does a query on a stats collector and calls a userCommand. When the dashboard that shows that calculated table is closed the table is not updated in 18.2. Only when opening the dashboard the table is updated.
In 19.0 the table is updated each time something happens to the stats collector where it is reading its information from. This is even the case when the dashboard is closed. Is it intended that the update mode always updates even when the dashboard is closed and nothing happens with the results of the calculated table?

Attached is a simple example model. There is a global variable that keep track of how many time the calculated table is updated.

Thanks,

Patrick

calculatedtablecall.fsm

Note, it is not possible to select 19.0.3 in the software version.

Accepted solutions (1)
12 Views
4 Replies
Replies (4)
Message 2 of 5

JordanLJohnson
Autodesk
Autodesk

@Ben Wilson @Paul Toone Can you guys check on the version option, and make sure you can select 19.0.3?

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 3 of 5

Ben_WilsonADSK
Community Manager
Community Manager

@jordan.johnson, @Patrick Zweekhorst,

Sorry for the delay. 19.0.3 is now added to the version selector.

0 Likes
Message 4 of 5

JordanLJohnson
Autodesk
Autodesk
Accepted solution

Hi Patrick,

The behavior is correct, for 19.0. In 18.2, the Always mode causes the query to be totally reevaluated, and the result table re constructed, every time you ask for a value from the table. If you have a chart or table open, then that can be very slow.

In 19.0, we made it so that in Always mode, the Calculated Table will check the query to see if incrementally updating is an option (among other qualifications, all FROM tables must be Statistics Collectors). If so, the Calculated Table will listen to the Statistics Collector events and incrementally update the result as the input tables change.

So here's the performance difference. Open the attached model, and make sure the view for the Calculated Table is open. In 18.0, it took 120 seconds to run the model to the stop time. In 19.0, it took about 35 seconds of the time. In 18.0, you will notice that the performance gets worse and worse as time goes on, because every time the screen paints, the query must be totally re-evaluated. In 19.0, performance may be slightly slower for the first bit, but it is consistent, and in the end is much faster.

Basically, in 19.0, we try to amortize the cost of the query across the whole model run, for more predictable performance.

So if you are only updating a query rarely, then I would recommend a different update mode, like By Interval. If you want complete control over when the query runs, you can either use Table.query() or you can tell the Calculated Table to update manually:

function_s(myCalcTable, "update", 1)

testalwaysspeed.fsm

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 5 of 5

patrick_zweekhorst
Advocate
Advocate

Hi @jordan.johnson,

Thanks for your answer. It looks like you made the calculated table a bit to smart for my original model from 18.2. I will change the update mode for the model in 19.0 and use the function_s.

0 Likes