Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unless you're building a really resource intensive app this is probably premature optimisation. I'd just go with whatever approach is easiest, and optimise the code later if performance proves to be a problem.</p> <p>Aside from that, there's probably not an absolute correct answer to this. There's several factors you need to weigh up:</p> <ul> <li>The time it takes to (re)construct a scene.</li> <li>The amount of memory that'd be used by inactive scenes</li> <li>How often scenes are going to be used</li> <li>How many scenes there are in total</li> </ul> <p>If constructing a scene is quick enough that a user won't notice, and doesn't involve downloading or loading extra resources then it would probably be fine to just re-render views every time. However if rendering takes a noticeable period then maybe you should think about keeping views around. Likewise, I'd definitely keep a cache of resources that might be re-used.</p> <p>On the other hand, I'd guess your views are going to be using really small amounts of memory (particularly compared to the gigs of RAM most machines &amp; phones have these days) so keeping them in memory probably isn't going to be much of an issue (unless you think you'll end up with thousands of them still in memory - really depends how many views you think the user will interact with in a single session)</p> <p>If you're really concerned about using too much memory, then you could always just cache some of the views rather than all of them - either by how likely to be re-used they are, or some sort of 'most recent views' scheme where the most recent 20 (or whatever) views are stored in memory, and the rest are constructed when they're needed. However this is a bit more complicated, and quite possibly overkill.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload