Tables Take a Long Time to Compute

From Q
Jump to navigation Jump to search

If a table is slow to calculate or seems to take a unreasonably long-time to compute, it is likely that the cause of this is one or more of:

  1. The table is using a large amount of data. For example, a Pick Any - Grid question with 20 rows and 20 columns will be computed using 361 variables, and will thus take a time to both extract the data and compute the variables.
  2. You are using banners when there is no need to use them. For example:
    • If there is only one question in your banner, it will generally be much faster to select that question in the Brown Drop-down Menu rather than use a Banner. The reason for this is that in the underlying computations, Q treats each category of the banner as a single variable. Thus if you have a question with, say, 100 categories, it creates 100 variables, which can substantially slow down performance.
    • If a banner consists of nested Pick One questions, such as gender-within-age, creating a new JavaScript Variable will achieve substantially faster computational performance. For example, if Gender has 2 categories and Age as 10, the following Expression will create a new variable with the nesting: Age + Gender * 10.
    • If a banner includes a variable that is only being used as a filter, it will generally be substantially faster to remove it from the banner, and instead use it to Filter the table.
  3. Excel-Style Formulas are being used with a large amount of data. Excel-style variables are much slower than JavaScript Variables. You probably won't notice the difference when you have thousands of cases, but you will if you have hundreds of thousands of cases.
  4. The variables being used in the table are JavaScript Variables (including Linked variables) which are computed using lots of other variables. When such variables are used in analysis Q needs to first load all the input variables and then compute the variables prior to computing the table.
  5. An Experiment or Ranking question is being analyzed.
  6. The table is very large. For example, where an ID variable is set as a Pick One question then any table that uses this question will be very large (e.g., if you have 10,000 respondents in the data file the table will contain 10,000 rows or columns).
  7. If JavaScript variables are very slow then consider using Tools | Save Data as SPSS File… to save out a copy of your data file with the calculations already done. This will make a larger data file, but may save time overall. (Before doing this Hide any variables that are not used in tables/charts so that they are excluded from the new data file.)

See also

Working with Large Data Files