Best practices and recommendations

Best practices and recommendations

For performance optimization, the following best practices are recommended

Use the recommended SDK version

Always use the recommended SDK version.
ThoughtSpot publishes a new version of the SDK for every major ThoughtSpot Cloud release. Make sure you review the changelog to know about the new features and enhancements, breaking changes, bug fixes, and deprecated features.

Use the appropriate embed package

The SDK provides different packages for embedding ThoughtSpot components in your app. Choose the appropriate package that suits your requirement. For example, if you need to embed multiple visualizations, consider adding them to a Liveboard and embed that Liveboard in your app.

To avoid page scroll as visualizations load on a Liveboard, you can set the fullHeight property to true in the LiveboardEmbed code.

Prefetch and cache resources

Use the prefetch method in the SDK to prefetch and cache static resources required for loading the embedded components. You can achieve this in two ways:

  • Use the prefetch method before calling init to cache static assets as early as possible (Recommended, as developers may need to call the init method later in their code).

  • Alternatively, if you can call the init method early, you can use the callPrefetch attribute in init directly instead.

Call init early

Call the init method as early as possible and complete authentication on application load.

Cache query results

To cache query results, tune the underlying data warehouse.