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

Make ipython cProfile-able #193

Closed
wants to merge 1 commit into from
Closed

Conversation

tomspur
Copy link
Contributor

@tomspur tomspur commented Oct 29, 2010

To get a cProfile of ipython inside of the git repo you could run:
"python -m cProfile ipython.py"

Currently file is wrongly detected and it crashes, after this commit, you get a proper cProfile.

@ellisonbg
Copy link
Member

I know this script is designed to just start ipython from the top-level source dir, but won't this mean that the script will no longer work if curdir is not the top-level source dir? That may be OK though. Can we make it work both ways?

@tomspur
Copy link
Contributor Author

tomspur commented Nov 5, 2010

Ha, I found another way (althought, it looks like a hack^^).

This works now both ways (but doesn't look nice anymore at least for me).

When using __file__ on startup and cProfile in the same time, __file__
is defined as the __file__ of cProfile and not the local ipython.py.
With using sys.argv[0] instead, it's possible to get a cProfile.
@minrk
Copy link
Member

minrk commented Feb 14, 2011

This fix does work for me in and out of the directory with ipython.py, but the following has always worked for me:

python -m cProfile `which ipython`

Brian, should I go ahead and merge this?

@ellisonbg
Copy link
Member

I haven't testing this, but it looks fine.

@tomspur
Copy link
Contributor Author

tomspur commented Feb 16, 2011

Merge branch 'ready_cProfile' of https://github.com/tomspur/ipython

closed by 604c8e1

markvoorhies pushed a commit to markvoorhies/ipython that referenced this pull request Apr 21, 2011
ellisonbg added a commit to minrk/ipython that referenced this pull request Jul 1, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
This pull request was closed.
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.

None yet

3 participants