bloomberg / memray

Memray is a memory profiler for Python
https://bloomberg.github.io/memray/
Apache License 2.0
13.17k stars 392 forks source link

Inverted flame graph #439

Closed ivonastojanovic closed 1 year ago

ivonastojanovic commented 1 year ago

Added inverted flame graph which is generated with --inverted command line argument. The tree's nodes with the same parent and location are merged when we check 'Hide Import System Frames' checkbox.

Fixes: #293

Describe your changes A clear and concise description of the changes you have made.

Testing performed Describe the testing you have performed to ensure that the bug has been addressed, or that the new feature works as planned.

Additional context Add any other context about your contribution here.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 91.37% and project coverage change: +0.16% :tada:

Comparison is base (0154228) 91.72% compared to head (9037cba) 91.89%. Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #439 +/- ## ========================================== + Coverage 91.72% 91.89% +0.16% ========================================== Files 90 90 Lines 10532 10766 +234 Branches 1450 1472 +22 ========================================== + Hits 9661 9893 +232 - Misses 868 871 +3 + Partials 3 2 -1 ``` | [Flag](https://app.codecov.io/gh/bloomberg/memray/pull/439/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg) | Coverage Δ | | |---|---|---| | [cpp](https://app.codecov.io/gh/bloomberg/memray/pull/439/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg) | `85.23% <ø> (+0.02%)` | :arrow_up: | | [python_and_cython](https://app.codecov.io/gh/bloomberg/memray/pull/439/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg) | `95.30% <91.37%> (+0.11%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files Changed](https://app.codecov.io/gh/bloomberg/memray/pull/439?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg) | Coverage Δ | | |---|---|---| | [tests/unit/test\_flamegraph\_reporter.py](https://app.codecov.io/gh/bloomberg/memray/pull/439?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#diff-dGVzdHMvdW5pdC90ZXN0X2ZsYW1lZ3JhcGhfcmVwb3J0ZXIucHk=) | `100.00% <ø> (ø)` | | | [src/memray/reporters/table.py](https://app.codecov.io/gh/bloomberg/memray/pull/439?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#diff-c3JjL21lbXJheS9yZXBvcnRlcnMvdGFibGUucHk=) | `94.28% <50.00%> (-2.69%)` | :arrow_down: | | [src/memray/reporters/transform.py](https://app.codecov.io/gh/bloomberg/memray/pull/439?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#diff-c3JjL21lbXJheS9yZXBvcnRlcnMvdHJhbnNmb3JtLnB5) | `96.29% <50.00%> (-1.79%)` | :arrow_down: | | [src/memray/commands/common.py](https://app.codecov.io/gh/bloomberg/memray/pull/439?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#diff-c3JjL21lbXJheS9jb21tYW5kcy9jb21tb24ucHk=) | `86.53% <80.00%> (-0.34%)` | :arrow_down: | | [src/memray/reporters/flamegraph.py](https://app.codecov.io/gh/bloomberg/memray/pull/439?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#diff-c3JjL21lbXJheS9yZXBvcnRlcnMvZmxhbWVncmFwaC5weQ==) | `91.66% <93.20%> (+3.66%)` | :arrow_up: | | [src/memray/\_ipython/flamegraph.py](https://app.codecov.io/gh/bloomberg/memray/pull/439?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#diff-c3JjL21lbXJheS9faXB5dGhvbi9mbGFtZWdyYXBoLnB5) | `95.45% <100.00%> (+0.06%)` | :arrow_up: | | [src/memray/commands/flamegraph.py](https://app.codecov.io/gh/bloomberg/memray/pull/439?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#diff-c3JjL21lbXJheS9jb21tYW5kcy9mbGFtZWdyYXBoLnB5) | `100.00% <100.00%> (ø)` | | | [tests/unit/test\_templates.py](https://app.codecov.io/gh/bloomberg/memray/pull/439?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#diff-dGVzdHMvdW5pdC90ZXN0X3RlbXBsYXRlcy5weQ==) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/bloomberg/memray/pull/439/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

godlygeek commented 1 year ago

As a heads up, I haven't looked at the JS or the tests yet, so the above comments are what I have to say about the Python side of the implementation.