# \[Feedback\] Perspective view load-ahead optimization

**URL:** <https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309>\
**Category:** Ignition Early Access\
**Tags:** ignition81, perspective\
**Created:** [April 6, 2021, 7:52pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309 "2021-04-06T19:52:27Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 9, 2021, 3:20pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/21 "2021-04-09T15:20:31Z")

</div>

Thanks for the test projects and demonstrations everyone. This is exactly what I was looking for in this thread. I think the strategy from here is to take this load-ahead concept and turn it into an option on components that embed views so that you can choose which ones load progressively and which ones load combined with their parent. I think in some circumstances you want to see the view put itself together before your eyes, and in other circumstances it’s better to hold off until sub-views are loaded before anything is displayed.

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [April 9, 2021, 3:42pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/22 "2021-04-09T15:42:02Z")

</div>

Set the loading mode of your views to ‘blocking’ and then check it out.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [April 10, 2021, 7:44am UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/23 "2021-04-10T07:44:53Z")

</div>

What I mean is the target of using embedded views are to create reusable and repetitive objects like native component for rapid development.

For example, I can create a button with embedded view with exact same functionality of the native perspective button component and both can do the same task. So here I can compare these two. OK?  
But the loading of perspective button component is 10x times faster than the embedded view.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 10, 2021, 1:45pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/24 "2021-04-10T13:45:15Z")

</div>

> [@nader.chinichian](#):
>
> So here I can compare these two.

But views are generic and support many configurations. A component does its thing and only its thing, and can be optimized for that. Why would you expect a generic construct to perform as well? I think you are being totally unrealistic.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [April 10, 2021, 3:14pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/25 "2021-04-10T15:14:21Z")

</div>

No I just miss and dream having embedded view like vision templates to be loaded fast. Even the new method have no good for this problem.

And for the record, there are other SCADA platfroms that has this in pure web and load very fast.  
What I am trying to say is may be Perspective should  
also introduce something else like template with some limited options but fast loading.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 14, 2021, 5:59pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/26 "2021-04-14T17:59:27Z")

</div>

Ok, back to an update on what this thread is actually about:

Because of the mixed results in real-world applications, we’ve put in an option on the Embedded View and Flex repeater components to opt-in to this optimization. The default will leave projects loading like they did before, but you can have your embedded view load inline with it’s parent by changing the new `loading.order` property.

We’re still analyzing the projects you’ve sent in to find more opportunities for improvement.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [April 14, 2021, 6:51pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/27 "2021-04-14T18:51:50Z")

</div>

Hi Carl,  
Is there any demo form your side that show the new optimization in action as some short video?

May be there is some thing I did wrong in my project that this new optimization doesn’t work for me.  
For example as you see my project include a lot of small embedded view of P&ID devices.  
Each include some text and SVG graphic with a lot of expression binding.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 14, 2021, 11:28pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/28 "2021-04-14T23:28:44Z")

</div>

Yes, I can put together a demo. I’m making some further optimizations based on the feedback I’ve gotten here, stay tuned…

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 16, 2021, 10:38pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/29 "2021-04-16T22:38:15Z")

</div>

Okay everyone, thanks for your patience. I have identified why this “optimization” ended up making many of your projects _slower_ where it had made my test project _faster_.

The difference had to do with breadth vs depth. The optimization helps the most on view configurations that are very deep - many layers down of embedded views. The projects that you’ve sent me were instead very shallow but quite broad - dozens or hundreds of views directly loaded underneath the first layer of the mounted view. In this style of configuration, the new loading strategy (which now called `loading.order: with-parent`) exposed a different inefficiency that we have now corrected. Now that both strategies are able to operate efficiently, the results are … still mixed, to be honest But don’t despair!

View loading performance is a complex topic, but the short story is: both strategies are now faster than they were before. In very deep nested view configurations, the `with-parent` strategy tends to be significantly faster. In broad configurations, the results are mostly a wash - they’re about the same speed. In some configurations, `after-parent` still wins by a hair. Which one you will want to use will come down to preference about how you like your views to feel as they load: progressively or all at once.

Furthermore, which one “feels” faster overall has a lot to do with the way property state is calculated and propagated to the views. While loading all the views at once is more efficient for the browser, it also delays the startup of the back-end of the view (e.g. bindings) until _all_ the views are loaded. In some cases, this can make `with-parent` feel slower, because when using `after-parent` even if it takes longer to load all the views, the topmost layers of views get started up sooner, and so their bindings get a head start on evaluating even as deeper views are still loading.

It is this area of initial binding execution and configuration state that we will be delving into for the next round of optimizations. But in the meantime, you can observe these side-by-side comparisons of the latest performance of `with-parent` vs `after-parent` in some test views.

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/0/d0ef3fbcd5273d192799b77374ced39cb006be39.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/0/d0ef3fbcd5273d192799b77374ced39cb006be39.mp4)
  

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/6/6621d0cda0dcefd00b06064aca64e58fabd5bb27.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/6/6621d0cda0dcefd00b06064aca64e58fabd5bb27.mp4)
  

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/2/a2b370157a31517de749acd486ba63a73c428587.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/2/a2b370157a31517de749acd486ba63a73c428587.mp4)

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [April 17, 2021, 7:14pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/30 "2021-04-17T19:14:22Z")

</div>

Are these footage are from 8.1.5-rc1?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 19, 2021, 3:49pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/31 "2021-04-19T15:49:56Z")

</div>

Not quite. They include two minor but impactful additional improvements that will be in 8.1.5-final

---

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [January 5, 2022, 11:30pm UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/32 "2022-01-05T23:30:09Z")

</div>

> [@Carl.Gould](#):
>
> The reason it works like this is that we can’t do an optimized loading-ahead for configuration values that aren’t present until some unspecified time later when a binding or script provides a value.

I am using embedded views for six columns in a table. Everything is pretty smooth unless the table.props.data binding returns a large number of rows. When that happens, you can watch each row's embedded views load and fill out. It is slow loading the embedded view and displaying the value, but the rest of the table's cells load almost immediately. Is there any way that I can speed up the loading process of the embedded column views? Are there any plans to make loading embedded views in this scenario faster?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [January 7, 2022, 7:43am UTC](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309/33 "2022-01-07T07:43:57Z")

</div>

Use pagination.  
If you use flex as root for your embedded view change it to coordinate.

[Previous page](https://forum.inductiveautomation.com/t/feedback-perspective-view-load-ahead-optimization/45309.md?page=1)
