Tips & trick to decrease startup loading time in perspective

Hi Chris,

I’ve got good news and bad news.

Bad news first:

Unfortunately there isn’t a lot you can do to speed loading times right now, but it depends on the nature of slowness you’re experiencing. There are project decisions that may influence load times.

Specifically: some components require rather large libraries to function. These libraries are not included in your project dependencies if the components which require them are not used. For example, I know the following components all have dependencies that are relatively large:

  • Datetime Components
  • Map Component
  • PDF Viewer
  • Charts
  • Markdown Component

Large dependencies mean an increased number and size of network requests (and corresponding loading time), which can really impact load times on slower networks/devices. These larger dependencies aren’t inherently bad, they’re just a byproduct of the component’s functionality - larger/more complex functionality needs more resource support.

So as a matter of ‘building for performance’, you may want to avoid adding these components to projects where they aren’t really used, or are used in minor features of your project. If a project is aimed at high performance, you might consider moving Views using these components to a second project that shares/inherits the same parent project who can act as the ‘data source’. Then you could keep your ‘high performance’ project down to a smaller dependency set, and then just link to the ‘heavy project’ when certain features of it are needed. There are obvious tradeoffs with this approach, but it might be workable depending on your scenario.

Good news:

Loading time/speed is something we are actively working on. One of the most notable improvements (among many) we are working on is to support local caching of perspective resources. While this isn’t going to improve ‘initial’ load times, it’s going to make a dramatic improvement in loading a project that has previously been loaded, and will be true for projects that use all the components mentioned above. Not sure on exact timeline, but likely 8.0.2 or 8.0.3.

Would be great if you could follow up with more information about the conditions you’re seeing slowness (slow network? Slow device? Certain project/pages?) so we have an additional datapoint to consider.

-Perry

3 Likes