Terry Raymond

Slow datacards? Check your dropdowns

Discussion created by Terry Raymond on May 4, 2020
Latest reply on May 4, 2020 by Terry Raymond

Sharing this with community in case it helps anyone.

 

We were suffering from very slow datacards, that were taking 5-10 seconds to load when clicking the file.  They were complex with different tabs based on the selected document type (eg there are many different types of PDFs, not just drawings).

 

At first we found that it seemed to be the more fields we added to the card, the slower it got.  And perhaps it got slower over time due to the VariableValue table growing to tens of millions of rows.  Wasn't really much we could do as we needed the fields, and didn't want to hack the database.

 

But recently we found that PDM actually loads all the variables very quickly, having lots doesn't affect performance too badly.  The major source of lag for us was the dropdowns.  I imagine that for each dropdown control, PDM has to query the database to get the options, which can add up to a lot of time.  So we updated our cards to minimize the number of dropdowns (which were duplicated on several tabs).  Even though the cards are still loading many variables, they are waaaaay faster now.

 

If curious, test it yourself by adding the same text field to a card say 50 times.  Notice no difference in card load time in explorer.

Then try adding a dropdown control and copy it 50 times.  Notice card now now has a few extra seconds of lag.

Outcomes