Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to measure only the second part (a region) of a program? #509

Closed
FabianSchuetze opened this issue Jan 28, 2024 · 1 comment
Closed
Labels

Comments

@FabianSchuetze
Copy link

Thanks for this wonderful repo - it's a pleasure to work with it.

I have a simple program that consists of two functions:

int main() {
    std::vector<float> data = preparation();
    Result res = calculation(data);
}

I am only interested in metrics related to the calculation function. Can I use toplev.py in such cases? If so, how?

I know roughly how long it takes to reach the calculation function. The wiki mentions that command line argument -D and says:

We run this with level toplev, skipping the initialization phase (about 80 ms). This is a useful technique with short programs to get better measurements (I measured the initialization phase before by just printing the time at the top of the program)

However, I do not see the option D listed in the available command line arguments for toplev.py.

@andikleen
Copy link
Owner

The toplev help only lists the toplev arguments, but it supports any perf arguments too. -D is a perf argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants