I wrote a program that continuously extracting specific format files to proper records for post processing, but the usage of CPU is keeping high, usually 99%.
So the extracting process was slowly and slowly, when I use sleep inside a loop, the CPU is down, but the extract performance wasn't improved because of sleeping.
I wonder what caused CPU keeping so high? Does my extract algorithm bad?
I use gprof to profile the program, nothing really helps. I was struggled what could I do, Please someone help me out.