bpo-32512: Add -m option to profile for profiling modules by mariocj89 · Pull Request #5132 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation16 Commits2 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

mariocj89

@mariocj89 mariocj89 changed the titlebpo-32512: Add -m option to profile for profiling modules bpo-32512: Add -m option to profile for profiling modules (WIP, adding tests)

Jan 7, 2018

@mariocj89 mariocj89 changed the titlebpo-32512: Add -m option to profile for profiling modules (WIP, adding tests) bpo-32512: Add -m option to profile for profiling modules

Jan 7, 2018

matrixise

@@ -553,11 +553,13 @@ def main():
import os
from optparse import OptionParser
usage = "profile.py [-o output_file_path] [-s sort] scriptfile [arg] ..."
usage = "profile.py [-o output_file_path] [-s sort] [-m module |escriptfile] [arg] ..."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you upgrade the documentation (Doc/library/profile.rst) and add a ..versionadded:: 3.8 ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! addressed 😄

matrixise

@mariocj89

Updated, let me know how it looks for you @matrixise. If the wording and structure looks ok we can see if any core developer is interested in this.

It is a "nice to have change" as it is mainly useful for people not having cProfile available but not really urgent.

matrixise

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this PR. Thank you so much for your job. Have a nice day.

@mariocj89

@matrixise

no problem, but I am not a core dev, you have to wait and see with a core review, maybe there will an other point to fix, but in this case, it's good adventure ;-) thanks again ;-)

@mariocj89

As a note for the reviewer, this follows the same implementation as the one in cProfile

This, therefore, includes by default the functions of using runpy. It is probably cleaner and better to get directly the code and pass it to profile to get those removed (as runpy