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 7511913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:42:23+00:00 2026-05-29T23:42:23+00:00

So I’ve been experimenting with vsperfmon through the vsperfreport/vsperfcmd command line tools with VS

  • 0

So I’ve been experimenting with vsperfmon through the vsperfreport/vsperfcmd command line tools with VS 2010. I’ve constructed a really simple program to profile and try to understand the numbers these tools output:

void DoStuff()
{
    double res = 0.0;
    for (double i = 0.0; i < 10000.0; ++i)
    {
        res += sin(i);      
    }
    printf("res is %lf", res);
}


int _tmain(int argc, _TCHAR* argv[])
{
    DoStuff();  
    return 0;
}

I profile the executable by running the steps as detailed here at the command line. The above gets compiled to perfPlay.exe, then I do the following steps:

vsinstr perfPlay.exe
vsperfcmd /start:trace /output:perfPlay.vsp
perfPlay.exe
vsperfcmd /shutdown
vsperfreport perfPlay.vsp /output:singleFile /summary:All

Here’s the odd thing I can’t figure out. The elapsed inclusive time for DoStuff is less than the inclusive time for sin() in both the function and caller/callee report:
Here’s the caller/callee report for DoStuff(), notice the Elapsed Inclusive Time for THUNK:sin vs the Root function

Type        Function Name       Elapsed Inclusive Time  Elapsed Exclusive Time  
Root        DoStuffInLib(void)  2157487                 0
Caller      _wmain  2157487 0   2157487                 0
Callee      __RTC_CheckEsp      57                      57  
Callee      _printf             347667                  347667  
Callee      THUNK:sin           2282622                 81435   

Elapsed inclusive time is defined as the amount of time taken to execute code in your function including functions you call. By that definition DoStuff’s inclusive time should always be > the inclusive time of sin. The difference above is relatively small, but if I let this thing run for a while it grows larger. This difference exists both in Debug and Release modes.

Why is it the case that sin’s inclusive time is higher? I would expect it to represent a portion of the Root entry’s time. I’m not quite sure whats going on or even if I can trust this tool if its doing seemingly weird stuff. I suspect though that I’m just missing something that would make things clearer for me.

  • 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-05-29T23:42:28+00:00Added an answer on May 29, 2026 at 11:42 pm

    The performance monitor uses probes to collect data. It tries to subtract the time taken by its own probes from the collected data, but this correction is approximate and it will often be consistently off in one direction or the other. Generally, the smaller the function you are trying to probe, the more inaccurate the measurements because the time taken collecting the data is a higher percentage of the time elapsed.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

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.