* * *

Author Topic: How to monitor cpu usage for a very small period?  (Read 456 times)

Pascal

  • Hero Member
  • *****
  • Posts: 693
How to monitor cpu usage for a very small period?
« on: June 12, 2018, 01:25:30 pm »
I've written a multi threaded COBOL parser. Which, even for large/complex programs, runs less than a second.

Is there a way to monitor cpu usage during the execution of all parser threads? I would like to know
if it uses all available cpu resources or if there is room for further parallelization.
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

Pascal

  • Hero Member
  • *****
  • Posts: 693
Re: How to monitor cpu usage for a very small period?
« Reply #1 on: June 12, 2018, 01:48:49 pm »
Found one:
Windows Performance Recorder and
Windows Performance Analyzer

Other suggestions?
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

Nitorami

  • Sr. Member
  • ****
  • Posts: 344
Re: How to monitor cpu usage for a very small period?
« Reply #2 on: June 12, 2018, 06:37:18 pm »
Not sure whether CPU usage truly reflects performance, as memory access could also be a bottleneck. A more reliable measure might be to allow your program to use only a specfic number of processors and compare the execution times.  For my own program, relative performance on a 4-core CPU is something like 1 : 1.8 : 2.2 : 2.4 for 1:2:3:4 cores. So I decided to generally limit it to use only 2 cores, as more is a waste of ressources. Which of course may be entirely different for youe program.


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus