Author Topic: High CPU usage during build operation when verbose is enabled  (Read 114 times)

Offline christo

  • Multiple posting newcomer
  • *
  • Posts: 26
Seeing high CPU usage by codeblocks, more than that of gcc, during compilation. I'm working external makefile project (makefile generated by cmake), and lot of verbose is enabled.

When analysed by perf, pcre2_match_32 is taking most of the CPU. Cause is that each of the build log line is check against 34 regular expressions.

I'm not much familiar with regex, but can anything to be done to improve the performance here?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5917
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I believe that there are a lot of codes to parse the compiler log message. So, if the compiler generate a lot of warnings, it takes a lot of time to parse those output.

So, sometimes, the building stage is really slow. :(

Not sure how to improve.

If I remember correctly, I have added some checks for the return line encoding, see this: The encoding text from GCC compiler should be UTF8 by default?

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
I would suggest disabling all the CB plugins you are not using or try selecting a different default compiler to see if any difference happens.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org