Jump to content

Multiple TERR Data Functions in a visualization - a performance question


Dmitry Surovtsev

Recommended Posts

Hello experts,

Can you possibly advise if there's any recommendation (performance-wise) about defining several TERR Data Functions to be called in a visualization, vs. assembling all TERR code in just one Data Function

In other words, are function calls between a visualization and a TERR function as time-efficient as calls within TERR code

Similarly, is there any time loss in transferring back and forth a Spotfire Data Table to a TERR dataframe during a function call, as compared to transfering dataframes inside TERR functions

Thank you.

Link to comment
Share on other sites

  • 4 weeks later...

I'm answering to myselffollowing a steep learning curve:

Try to avoid multiple data functions by all means if your dashboard follows a sequential (i.e. Excel-style)calculation logic.Put all your R code in one data function.

This is actually not a performance issue (I changed from 5 to 1 data functions after my dashboard was finished, and could not notice major time improvement). This is about Spotfire "asynchronous" launching of data functions, where calculation dependencies between functions are notobserved at all.

There are a few support articles here about "running data functions in a specified order" that rely on a IronPython script launching TERR data functions. You may try those, but I didn't like this workflow. In particular, it will require calling your data functions by a character stringname , meaning that if you rename a TERR data function, the IronPython script won't find it. Also, I suspect that ExecuteSynchoronously method is not the end of the story. You may also need to refresh a data table after executing a data function before calling another data function. Anyway, there was something weird about my dashboard behaviour when mydata functions were called from IronPython that I found it easier just to move all code to one TERR function.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...