Time

Optimizing Load Time

scalf's picture

I ran into an interesting situation recently involving the arrangement of patches affecting the load time of a composition.

I am writing a comp that lets a 4x4 array of buttons control a 4x4 array of sprites. The core of the patch adds different boolean values together and is then combined into a structure heading to the sprites.

It works no problem, except when I started over and loaded the comp it took on average 45 seconds to load. What? It ran just fine and was smooth prior. Although the layout is a massive amount of math patches I felt that there should not be a reason it takes so long to load. Of course once it does load it runs just fine. Also, entire program is only 2.9mb

Is it because Quartz compiles the composition before each load?

I then decided to play around and found that the more nested the functions were the faster it loaded. I started by taking chunks and making them macro patches - below you can find an image illustrating this. And by combine I mean the code stayed the same it was only how it was arranged that differed.

Is this per usual?

I had no idea that the nesting of patches had anything to do with loading a comp. In fact I thought that it would make it faster if all macros were exploded.

Can anyone shed light on this or point towards a resource that covers this?

Any insight appreciated.

CVTools Detecting lines after a time

benoitlahoz's picture

Hi !

I'm trying to detect lines from a movie / video input to trigger another movie stuck to these lines.

Actually, when the image is totally motionless it works very well, but a little movement make the Line Detection "panic".

What I would like to do is to wait a certain amount of time testing if there is movement in the image, and then trigger a line detection only once to launch the second movie.

I guess I have these steps to realize, but I can't manage to find how :

  1. testing movement in time
  2. triggering one detection if the image is not moving too much (it can't be really motionless if this is a video input / movie)
  3. storing the line structure
  4. testing again if there is movement. If yes : I delete the stored lines and then restart at point 1.

I wonder how to make a median of velocities values in time. May be with a queue ?

Any idea ?

Thanks a lot in advance !

Time Smear

dwskau's picture

These are real-time versions of some time smear effects. On a brand new MBP they run best at around 24 iterations. If anyone has any suggestions to improve performance and get more iterations, I would love to hear them.

Time Duration (Composition by smokris)

Author: smokris
License: MIT
Date: 2010.04.08
Compatibility: 10.5, 10.6
Categories:
Required plugins:
(none)

Given a number of seconds, produces a human-readable string description of the time period.

E.g., converts "5502" into "1 hour, 31 minutes, 42 seconds".

Based on PHP code from http://aidanlister.com/2004/04/making-time-periods-readable/