When are clips loaded?

I’ve noticed that when I perform certain actions for the first time, I get breaks in the frame rate, but not subsequent times. I’m not sure if that’s because of the motion clip or the audio stream to go with it, but for sure it only happens the first time.

Can I get an explanation of when clips and audio streams are opened by Touch, and why - if they’re not in memory - it wouldn’t happen a second time (i.e. aren’t the files closed then?).

If - maybe by the way I’m doing things for example with my audio streams networks - the file is opened once but never closed, how many open files can I have and does that affect performance?

thanks!!
d

All nodes load their data the first time they cook. All CHOPs (with the exception of Audio Stream and Audio Movie CHOPs), open their target file(s), load the entire contents into memory and then close the files. Unless something changes (like the path, or other parameters in the File CHOP), the file won’t be opened again. This is why you see a hiccup the first time but not again.
Audio Stream and Audio Movie keep the file open and stream small chunks of data from it as it plays. They open their file the first time they cook.

I wouldn’t expect there to be a performance penalty for having too many files open (unless it’s excessive, which I can’t quantify), but there is an invisible memory cost. The OS will copy some or all of the file’s content into memory (we have no control over how much), which will eat up your available memory, but this amount isn’t reflected in the Task Manager. So as long as you’re not running out of memory, you should be ok.