-
Notifications
You must be signed in to change notification settings - Fork 241
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
Hide IPython internal frame by default. #321
Conversation
I'd love to see a pyisession file for this issue you're hitting in ipython. It seems to me that our ipython support has a bad assumption, the issue can probably be resolved in a more robust/targeted way. |
I agree, unfortunately this is a bug at a client that have sensitive code I'm not allowed to see/use, so even I can't reproduce the issue. Working on this locally required me to patch the source code to have So I'm not sure what kind of reproducer I could add. Regardless, beyond this issu, the feedback I got about pyinstrument from the clients are great. |
hm.... okay. in that case, can you add this processor only to renderers called from the magic.py file? Could it be more targeted to only trim stems? Also, I think it would be okay to delete the frames entirely, rather than hiding them - this can be done by calling |
Sure, I can try to do that. |
This should help with joerick#313 In most case it should have no effects as anyway all the root of the tree is removed as there is no time spent in it. Though with some compiled code and threads, some time may be affected to the root.
Ok, I added a default processor that strips nothing by default and activate itself when passed the right options (which I pass from the magic). While I was at it I added a Do you want me to rebase/squash to clean the commits ? |
Let me know if there is some changes or updates I can include, or if I can help you with something else to free you some time. |
I'm not convinced by the adding of |
I've made a change to how the processor is included, and how it works, to prevent a crash if the root frame comes from one of those paths listed. Just a note... I'm not sure how this solution might age, cos the specific code paths and filenames in IPython might change, and we have no reproducer to test with. So I can't promise your issue wont come back... it's more of a bandaid until we can get a reproducer and find out why trim_stem is stopping short in this instance. |
My thinking is those are the ones I also wan to remove as they appear in the bug my client reported in #313 (the root get assigned some time for I don't know which reason). I originaly went in some place with
Yes, I'm aware I'm sad I can't really reproduce it; I'm hopping that the core reason of why it happen will become clearer with time, and then I can submit a proper fix. I'm also maintaining IPython so if there are changes in filenames then you can blame on me (and I can blame it on myself). And can send a fix. |
Would you be okay with removing that
I had forgotten you maintain ipython :) It's a deal. Thanks for your work on ipython by the way. I use it quite a bit, normally in the console. |
Yeah, I can look into remove it.
No worries, It's not much maintenance, and if you need anything on IPython itself let me know. |
Sorry, I wasn't that clear, I meant to remove the trim_stem as a renderer option entirely. Just pushed a commit for that. I'm assuming it was only for debugging purposes on your side? |
Ah, ok, no worries. Yes it was mostly to see what it looked like when the step was not trimmed. Thanks |
This should help with #313
In most case it should have no effects as anyway all the root of the tree is removed as there is no time spent in it. Though with some compiled code and threads, some time may be affected to the root.