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

  • SEARCH
  • Home
  • 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 9195553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:39:09+00:00 2026-06-17T21:39:09+00:00

I am trying to figure out how does program profiling work. I am using

  • 0

I am trying to figure out how does program profiling work. I am using Valgrind. My first question is:

What does the cost of a function mean for Valgrind? Is is time?

From what I read, it seems that Valgrind runs the program on a virtual machine that is supposed to mirror a “generic computer”. It then counts events occuring in this machine. But how does it compute the cost of a function from this data? Can times smaller than 1 millisecond be measured on a standard desktop PC?

enter image description here

Edit:

Please what does the 1 dimensional number “cost” mean in the output of callgrind?

  • 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-17T21:39:10+00:00Added an answer on June 17, 2026 at 9:39 pm

    What does the cost of a function mean for Valgrind? Is is time?

    Assuming you’re referring to the Cachegrind and Callgrind tools, they don’t measure “cost”; they measure specific statistics gathered from running the program on a simulated processor including:

    • Cache reads and misses
    • Conditional and indirect branches executed and mispredicted

    For full details, see the documentation.

    Other profilers measure the elapsed time for each function, or use sampling to determine which functions the program spends the most time in.

    Can times smaller than 1 millisecond be measured on a standard desktop PC?

    Yes, most modern computers have timers with an accuracy of less than a microsecond, and modern Intel processors allow you to count CPU cycles. But Valgrind doesn’t measure elapsed time, since that’s meaningless on its simulated machine.

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

Sidebar

Related Questions

I am trying to figure out Event Loops in Perl? Currently my program does
I am trying to figure out the memory consumption by my (C++) program using
I'm trying to figure out if g++ -fsyntax-only does only syntax checking or if
I am trying to figure out why my $.getJSON method does not seem to
Specifically, I'm trying to figure out if it's possible to generate SQL that does
I'm trying to figure out why one of my objects does not seem to
I am trying to figure out how to make my program count the number
I am currently trying to figure out how to use Eclipse to program Escape
I am trying to figure out why the rbind function is not working as
I'm making a slider, and I'm trying to figure out how I'd program a

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.