GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — gh-142927: Show module names instead of file paths in flamegraph by ivonastojanovic · Pull Request #146040 · python/cpython Conversation
|
|
As I am on mobile it is hard to review but is it possible to have an option to keep showing full paths? this may help if we want to open the file in an IDE. Or does this change only affect the flamegraph output? Alternative: show the full path of the selected cell as a footer |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a3d38ad to
b5eeefb
Compare
@picnixz That’s a great idea. I’ve added a toggle that lets users switch between full paths and module names. Toggling it updates both the flamegraph frames and the hover tooltips. This change only affects the flamegraph output. Let me know what you think of the toggle. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Toggling was one solution I had in mind so it is fine! showing full path without toggling as a small footer with a "copy path" if you were to double click the footer would also be an alternative/follow-up improvement. Otherwise just toggling is great! thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
b5eeefb to
518c923
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
some comments
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| if (useModuleNames) { | ||
| return moduleName || filename; | ||
| } | ||
| return filename ? filename.split('/').pop() : filename; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The toggle is labeled "Full Paths" but this returns filename.split("/").pop() which is the basename. Also the tooltip builds displayName differently (using the full filename), so different parts of the UI disagree on what to show.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What do you think about “File Paths” and “Module Names”? I updated displayName to return the filename and kept the tooltip showing the full path, does that sound okay?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Move module name extraction logic from heatmap_collector to shared module_utils to enable flamegraph to display module names instead of full file paths.
Display module names instead of full file paths (/home/user/project/pkg/mod.py → pkg.mod) in flamegraph for readability.
Users can now switch between module names and file paths using the toggle in the View Mode sidebar. Module names are concise, while file paths help locate the exact source file, both are useful depending on the debugging context.
_path_to_module included the root separator (/ or drive letter) when converting absolute paths to dotted module names, producing /.tmp.project.main instead of tmp.project.main.
Replace _is_subpath helper with Path.is_relative_to() (available since 3.9), removing the double relative_to() call.
Rename "Full Paths" to "File Paths", remove basename-only
.split('/').pop() so tooltip, hotspots, and search all show the
same path in file-paths mode.
518c923 to
36764cb
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.