idle cpu usage on mac

why CPM using cpu 50%-60% in IDLE position? (main project opened)
also sometimes jumps rapidly 90%

MacBook Pro - OSX 10.7.2
2.53 GHz i5 - 4 GB [import]uid: 96683 topic_id: 21896 reply_id: 321896[/import]

It’s scanning your project directory to see if you’ve added any new files that should be automatically added to the current project.

If you right-click a project and choose Edit Project you can uncheck the box that handles that. There’s no way in the current version to turn that off globally - it’s on a project-by-project basis.

In the next version I’m looking at ways to only check at specific times, instead of once every second (or two). For example, if CPM activates it means you may have been in the Finder doing something with files and so it should check. But after that initial check CPM shouldn’t need to check again for as long as it’s the active program – I don’t think.

I still need to figure out the best logic for this. And I’m open to suggestions.

Jay
[import]uid: 9440 topic_id: 21896 reply_id: 87168[/import]

Jay, you should use Apple’s FSEvents for this. It was designed to help you do this kind of thing in the most efficient way possible. It’s what Spotlight and Time Machine are built on and what we are using in the Corona Mac Simulator.
[import]uid: 7563 topic_id: 21896 reply_id: 87169[/import]

Thanks, I’ll look into that, but the dev environment I use is kind of like Corona – I give up some power in exchange for quick, cross-platform development. I may not have access to FSEvents, but I’ll poke at it and see.

Thanks for the tip.

Jay
[import]uid: 9440 topic_id: 21896 reply_id: 87172[/import]

I understand.

If you do need to continue building your own, you should be periodically checking even if CPM is active because it is possible for the underlying filesystem to change behind your back. One example is that you are working with a partner and they have changed your files through the network (ftp, smb, afp, etc).

[import]uid: 7563 topic_id: 21896 reply_id: 87175[/import]

I can also check less frequently – in fact, allowing the user to set that interval would be nice, the only downside to that is creating a UI for that.

I may just go ahead and add something like an ini file that people can edit if they want to. No interface for me to mess with, but the ability to tweak CPM to be more personal per user.

I don’t like that because it’s not “Mac-like” but it would save me time vs rolling a UI for that. :slight_smile:

Jay
[import]uid: 9440 topic_id: 21896 reply_id: 87204[/import]

thanks [import]uid: 96683 topic_id: 21896 reply_id: 87461[/import]