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

add concept of execution time to diff #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sdmcclain
Copy link
Owner

@sdmcclain sdmcclain commented Apr 21, 2017

This PR does two things:

  1. Adds the concept of Execution time, by printing it to the top of the file.

In https://github.com/mcclaized/edav_final_project/blob/master/bin/run_pyflame, I run the code twice, first to grab the execution time of the program with no profilers adding overhead, the second using pyflame to generate the profile.

I am passing this forward, because it will be used in sdmcclain/node-stack-convert#1 to determine the number of seconds that each function call contributes to the overall runtime.

  1. Adds a new mode (triggered with the -u option) that compares only the differences of two profiles. https://github.com/corpaul/flamegraphdiff deserves a major shout out for the inspiration of this work, but my implementation is somewhat different.

Without -u, each line represents a call stack, and is followed by 2 numbers, representing the number of times the two inputs files were sampled at this call stack:

difffolded.pl profile1.folded profile2.folded gives
my_file.py:38 4 2

where 4 is the number of times the program was sampled at line 38 of my_file.py in profile1 and 2 times in profile 2.

In the -u mode, the output is different. We first discard any case where the number of calls is the same, then we take the diff abs(profile2_calls - profile1_calls) and store it as the first number, with the sign as the second number. So, in the above example, the output would be:

my_file.py:38 2 -1

Because 2 is the difference in number of calls, and the -1 signifies that the second file has fewer calls than the first.

See sdmcclain/node-stack-convert#1 for details on how this will be used

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

Successfully merging this pull request may close these issues.

1 participant