Destroy outside layout question

  • The question is:

    I got 2 examples:

    Behaviour "destroy outside layout"

    and

    Every 40 sec

    Item is outside layout

    -> Destroy item

    Will i get a performance benefict by using the second one? Because i don't care if the effect doesn't trigger at every tick, i just need to clean the items outside layout every few seconds... but if there is absolutely no difference in CPU usage, then i'll go with the first solution.

  • No difference at all.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I do not know how the behavior is coded, but I would think destroying objects once every 40 seconds would have a larger hit on the garbage collector all at once than many small deletes would... and of coarse things would be building up in memory for 40 seconds which has a larger memory footprint than deleting as you go. During any one second computers usually have large amounts of unused processor cycles so the time spent cleaning up little things constantly is probably most efficient.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)