Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8503947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:53:38+00:00 2026-06-11T01:53:38+00:00

I just made some benchmarks for this super question/answer Why is my program slow

  • 0

I just made some benchmarks for this super question/answer Why is my program slow when looping over exactly 8192 elements?

I want to do benchmark on one core so the program is single threaded. But it doesn’t reach 100% usage of one core, it uses 60% at most. So my tests are not acurate.

I’m using Qt Creator, compiling using MinGW release mode.

Are there any parameters to setup for better performance ? Is it normal that I can’t leverage CPU power ? Is it Qt related ? Is there some interruptions or something preventing code to run at 100%…

Here is the main loop

//  horizontal sums for first two lines
for(i=1;i<SIZE*2;i++){ 
    hsumPointer[i]=imgPointer[i-1]+imgPointer[i]+imgPointer[i+1];
}
// rest of the computation
for(;i<totalSize;i++){ 
    // compute horizontal sum for next line
    hsumPointer[i]=imgPointer[i-1]+imgPointer[i]+imgPointer[i+1];
    // final result
    resPointer[i-SIZE]=(hsumPointer[i-SIZE-SIZE]+hsumPointer[i-SIZE]+hsumPointer[i])/9; 
}

This is run 10 times on an array of SIZE*SIZE float with SIZE=8193, the array is on the heap.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:53:40+00:00Added an answer on June 11, 2026 at 1:53 am

    There could be several reasons why Task Manager isn’t showing 100% CPU usage on 1 core:

    1. You have a multiprocessor system and the load is getting spread across multiple CPUs (most OSes will do this unless you specify a more restrictive CPU affinity);
    2. The run isn’t long enough to span a complete Task Manager sampling period;
    3. You have run out of RAM and are swapping heavily, meaning lots of time is spent waiting for disk I/O when reading/writing memory.

    Or it could be a combination of all three.

    Also Let_Me_Be’s comment on your question is right — nothing here is QT’s fault, since no QT functions are being called (assuming that the objects being read and written to are just simple numeric data types, not fancy C++ objects with overloaded operator=() or something). The only activities taking place in this region of the code are purely CPU-based (well, the CPU will spend some time waiting for data to be sent to/from RAM, but that is counted as CPU-in-use time), so you would expect to see 100% CPU utilisation except under the conditions given above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering about some practice about this; I have made a simple visual C#
so I'm making some basic programming language (just for exercise). I've made simple grammar
I just made my first website , and I notice that the elements start
I was just looking at this answer , which contains the code for Nullable<T>
I've just cloned a repository, made some changes and now I'd like to send
I have a git project. I just made a commit, then I deleted some
I am sure that I have made some painfully obvious blunder(s) that I just
My guess is it just made parsing easier, but I can't see exactly why.
Today I just read some comments and I made some experiment. I imagined a
I've just pulled a new branch, made some local changes, committed and tried to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.