If you program really needs to shuffle a lot of data, high CPU usage could be normal. It all depends. Many times however, a program does way too many unecessary things.
It would be difficult to give detailed advice without seeing the code, but here are some ideas for you could check.
- Don't constantly resize large arrays (built array, insert into array, delete from array).
- Place small wait statements in all toplevel loops.
- Use event structures instead of polling loops.
- Avoid overlapping objects on the front panel.
- Avoid coercions. Use proper datatypes for everything.
- Avoid complicated data structures.
- Don't set the history lenght of charts to some outrageous value. If you need a long history, stream it to disk.
- Don't send many megabytes of data to graphs. Most graphs are less than 1000 pixels wide so you cannot really show more than that anyway.
- Don't shuffle data around via value property nodes.
- If you need to stream data to file, keep the file open and use low level file IO. High-level file I/O will open and close the file for each operation.
- Don't do unecessary operations, take calculations out of loops unless their inputs change (the compiler often does a good job with folding, but still...)
- ...
- ... (I am sure others have many more suggestions).
Remember, only a few years ago computers where much less powerful but we were still able to write impressive programs. Yes we did! Any code that on the average uses more than a few percent of the CPU times is probably inefficient and wasteful unless it is doing real computations.
If you could attach your code, we could be much more specific.
Message Edited by altenbach on 04-28-2007 10:36 AM