GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Flamegraph usability improvements: legend, toolbar, context menu by krk · Pull Request #1140 · async-profiler/async-profiler

Conversation

@krk

@krk krk commented Feb 17, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Legend

Add a legend to the flamegraphs, in the style of the heatmap.
image

Toolbar

Toolbar buttons are redesigned.
image

Context menu

New context menu added to the canvas, which can highlight a frame type or hide a frame. The type is highlighted and other frame types are de-emphasized.

image

Related issues

#379

Motivation and context

Colors in the flamegraph have different meanings, which can be learned over time. Instead, provide a legend.

How has this been tested?

Testing the UI manually.

make test

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

shakuzen and JarvisCraft reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@roy-soumadipta

roy-soumadipta commented Feb 17, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Should we mimic the one in https://github.com/async-profiler/async-profiler/blob/master/docs/FlamegraphInterpretation.md#understanding-flamegraph-colors?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

apangin
apangin reviewed Feb 17, 2025
View reviewed changes
Comment thread src/res/flame.html Outdated
const legendDetail = document.getElementById('legendDetail');
const legendItems = legendDetail.getElementsByTagName('div');
for(let i = 0; i < palette.length; i++) {
legendItems[i].style.backgroundColor = getColor(palette[i]);

@apangin apangin Feb 17, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

getColor returns random color within palette range. Should we use stable color for the legend?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Feb 18, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yes. Colors will not match exactly to what is in the flamegraph in any case, I don't mind either way.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/res/flame.html Outdated
search(true);
}

document.getElementById('legend').onclick = function() {

@apangin apangin Feb 17, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What if a legend appears automatically when hovering over? Won't it be a better UX?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Feb 18, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I imagine accidental appearances would not be helpful. Other buttons in the same area work with a click, I think this is consistent.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@simonis

simonis commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

I love this and I'm really looking forward for this being integrated!

I have two suggestions though: please consider choosing more distinct colors for interpreted frames. Interpreted code is really a performance killer and should clearly stand out in a flame graph.

The second suggestion is about naming. We currently have "jitted" and "c1 compiled" but c1 compiled is also jitted. So consider renaming jitted into "c2 compiled".

Also, I'm not sure how AsyncProfiler is displaying JVMCI compiled frames? Are they currently shown as "jitted"? In that case, replacing "jitted" with "c2 compiled" might be a bad choice and "JIT highest tier" and "JIT low tier" might be a better alternative. To further complicate things, we can have C1, C2 and JVMCI compiled methods if we're running the Graal compiler in hosted mode (for Truffle only) but I'm not sure if C2 and JVMCI compiled methods will be distinguishable in that case?

krk and StevenCurran reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@simonis

simonis commented Mar 16, 2025

Copy link
Copy Markdown
Contributor

Some more comments/suggestions:

  1. @apangin explained to me that only flamegraphs taken with cstack=vm have the correct JIT/Inlined/C1 information and coloring on all Java frames. This means that we will have to adapt the legend based on the cstack option because all the other flamegraphs only have the correct JIT/Inlined/C1 information only on top frames which are mostly invisible most of the time because of their size. Displaying the same legend on such graphs will be just confusing because it might show frames as JIT-compiled although they are in reality interpreted.
  2. The Unicode character you choose for the button (i.e. &#x1f6c8;) doesn't display on Ubuntu 22.04, neither in Chrome nor in Firefox. Can we come up with something more portable?
  3. I'm not an HTML/CSS pro, but I think it should be possible to make the legend a real pop-up menu which will be display over the existing graph and not shift the whole graph downwards.
krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apangin
apangin force-pushed the master branch from ee69cf1 to a78793b Compare March 20, 2025 10:38
@krk krk mentioned this pull request Mar 24, 2025
Adjust legend when JIT/inlined/C1 is missing in flamegraphs #1191
Closed
2 tasks
@krk

krk commented Mar 24, 2025

Copy link
Copy Markdown
Contributor Author

Thank you @simonis for your suggestions.

  1. I have made interpreter color more distinct
  2. Renamed C1/C2 to be more descriptive: Java C1 compiled (jitted), Java compiled (jitted C2/JVMCI)
  3. Updated the unicode character to an icon from an older unicode standard.
  4. Legend is a div popup now.

flamegraphs taken with cstack=vm have the correct JIT/Inlined/C1 information and coloring on all Java frames. This means that we will have to adapt the legend based on the cstack option because all the other flamegraphs only have the correct JIT/Inlined/C1 information only on top frames which are mostly invisible most of the time because of their size. Displaying the same legend on such graphs will be just confusing because it might show frames as JIT-compiled although they are in reality interpreted.

Created #1191 to track this improvement.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@simonis

simonis commented Mar 24, 2025

Copy link
Copy Markdown
Contributor

Thanks @krk, that looks pretty neat now. I like the pop-up version much more than the previous version. The new button now displays fine on Linux.

The only remaining nit-picking from me would be to change the label for "C++" frames from "C++" to something like "C++ (VM)" to make it clear that this is HotSpot code in contrast to all the other native code which might also be C++ code.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@krk

krk commented Apr 5, 2025

Copy link
Copy Markdown
Contributor Author

unrelated failure:

FAIL [62/63] JfrTests.ttsp took 4.114 s
java.lang.AssertionError
	at test.jfr.JfrTests.ttsp(JfrTests.java:93)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at one.profiler.test.Runner.run(Runner.java:133)
	at one.profiler.test.Runner.main(Runner.java:230)
INFO: Running JfrTests.ttspNostop...
PASS [63/63] JfrTests.ttspNostop took 4.260 s

Failed tests:
JfrTests.ttsp
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marcelocenerine
marcelocenerine reviewed Apr 18, 2025
View reviewed changes
Comment thread src/res/flame.html Outdated
}

document.getElementById('legend').onclick = function() {
legend = !legend;

@marcelocenerine marcelocenerine Apr 18, 2025

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This variable ^^^ isn’t reset to false when the popup closes, so the user must click the "legend" button twice to reopen it. Since the pop-up overlays the page, it’s probably ok to remove this flag altogether.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@krk krk changed the title Add legend to flamegraphs Flamegraph usability improvements, legend, toolbar, context menu Apr 25, 2025
@krk krk changed the title Flamegraph usability improvements, legend, toolbar, context menu Flamegraph usability improvements: legend, toolbar, context menu Apr 25, 2025
@krk
krk force-pushed the flamegraph-legend branch 3 times, most recently from 8a03457 to 4df3390 Compare July 9, 2025 11:01
@krk
Flamegraph usability improvements: legend, toolbar, context menu
0b76c4d
@krk
krk force-pushed the flamegraph-legend branch from 4df3390 to 0b76c4d Compare July 9, 2025 11:07
@krk

krk commented Jul 9, 2025

Copy link
Copy Markdown
Contributor Author

Updated based on latest offline discussions.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk added 5 commits July 9, 2025 12:19
@krk
Remove Help title from help icon, it already has a tooltip
f880e48
@krk
Increase help tooltip margin
79eedca
@krk
Center title
0487171
@krk
Prevent text selection on double-clicking invert button
8ac72ec
@krk
Do not select the title when double-clicking the invert button
5e1c3e2
apangin
apangin reviewed Jul 9, 2025
View reviewed changes
Comment thread .assets/images/flamegraph.png

@apangin apangin Jul 9, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Image became 3830px wide - was it intentional change? IMO, this is too large.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@krk krk Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

High dpi screenshot, fixing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/res/flame.html Outdated
a {color: #0366d6}
#hl {position: absolute; display: none; overflow: hidden; white-space: nowrap; pointer-events: none; background-color: #ffffe0; outline: 1px solid #ffc000; height: 15px}
#hl span {padding: 0 3px 0 3px}
#hl span {padding: 0 2px 0 2px}

@apangin apangin Jul 9, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why are all these changes in margins and paddings?
Now, frame title jumps whenever I hover a pointer over it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Reverting these paddings, doesn't fix the jumping. I can see that behavior on master as well:

jumping-frame-title

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@apangin apangin Jul 11, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Hm.. might depend on the OS/browser. It does not jump in Chrome.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/res/flame.html Outdated
}

function search(r) {
function search(r, resetZoom) {

@apangin apangin Jul 9, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

How resetZoom is related to search?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

search is used as the rendering method. In any case, removing the resetZoom argument.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/res/flame.html Outdated
pattern = r ? RegExp(r) : undefined;

if (resetZoom) {
root = origRoot;

@apangin apangin Jul 9, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What is origRoot? Can it be different from the all frame at level 0?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

origRoot is the root of the first search call, which should be the all frame. Renaming to allRoot.

Using levels[0][0] now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/res/flame.html Outdated
canvas.style.cursor = 'pointer';
canvas.onclick = function() {
if (event.altKey && h >= root.level) {
if (event.altKey && h > root.level) {

@apangin apangin Jul 9, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

OK, "all" frame should never be removed, but otherwise what's wrong with deleting stack at current level?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Fixing by disallowing removal of all only.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/res/flame.html Outdated

function invertMode() {
inverted = !inverted;
btnInvert.style.rotate = inverted ? '180deg' : '0deg';

@apangin apangin Jul 9, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit: the icon is rotated, but the graph is mirrored, not the same thing :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with heart emoji
All reactions
  • ❤️ 1 reaction

@apangin apangin Jul 9, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

But seriously, I'd prefer a static icon (like up-down triangles or whatever you invent). Two-state toggle buttons are always confusing: whether they show current state or a state to switch to.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Changed to a static icon.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
krk added 2 commits July 10, 2025 11:08
@krk
Smaller screenshots
cd52e1a
@krk
address comments
5286a66
apangin
apangin reviewed Jul 11, 2025
View reviewed changes
Comment thread .assets/images/flamegraph_legend.png Outdated

@apangin apangin Jul 11, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't think the image in docs is worth replacing with a roughly cropped screenshot, especially since it duplicates information already available on a flamegraph and includes info about shortcuts which is irrelevant here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/res/flame.html Outdated

<div id="search" class="toolbarIcon" title="Search by Regex [Ctrl + F]"><svg height="20px" width="20px" viewBox="-39.26 -39.26 471.13 471.13" xml:space="preserve" fill="#000000" stroke="#000000" stroke-width="0.00392609"><path style="fill:#FFFFFF;" d="M273.713,147.774c0,69.495-56.501,125.931-125.931,125.931c-69.495,0-125.931-56.501-125.931-125.931 c0-69.495,56.501-125.931,125.931-125.931C217.212,21.843,273.713,78.344,273.713,147.774z"></path><path style="fill:#40b2ff;" d="M370.747,348.695c0,1.422-1.616,6.271-7.176,12.283c-6.206,6.659-12.477,9.762-14.739,9.762h-0.065 c-19.459-1.616-61.996-43.184-109.576-106.796c0-0.065,0-0.065,0-0.129c9.18-7.24,17.455-15.515,24.63-24.63 c0.065,0,0.065,0,0.129,0C327.564,286.699,369.131,329.301,370.747,348.695z"></path><path style="fill:#ff8d40;" d="M208.679,86.877l-14.481,14.481c-17.131,17.131-46.545,5.042-46.545-19.265V61.6 c-49.002,0-88.372,40.792-86.109,90.246c2.004,43.895,38.141,80.032,82.036,82.036c49.455,2.263,90.246-37.172,90.246-86.109 C233.956,124.049,224.323,102.522,208.679,86.877z"></path><path style="fill:#004d80;" d="M276.105,220.954c12.347-21.527,19.459-46.545,19.459-73.18c0-81.455-66.327-147.717-147.846-147.717 S0,66.32,0,147.904s66.327,147.717,147.717,147.717c26.57,0,51.523-7.111,73.18-19.459 c39.822,53.333,91.863,113.519,126.061,116.364c12.283,0.517,22.885-6.723,32.776-16.743c5.172-5.624,13.77-16.937,12.8-28.768 C389.624,312.881,329.438,260.776,276.105,220.954z M147.717,273.77c-69.495,0-125.931-56.501-125.931-125.931 S78.287,21.908,147.717,21.908s125.931,56.501,125.931,125.931S217.212,273.77,147.717,273.77z M363.572,360.978 c-6.206,6.659-12.412,9.762-14.739,9.762h-0.065c-19.459-1.616-61.996-43.184-109.576-106.796c0-0.065,0-0.065,0-0.129 c9.18-7.24,17.455-15.515,24.63-24.63c0.065,0,0.065,0,0.129,0c63.612,47.58,105.18,90.182,106.796,109.576 C370.747,350.118,369.131,354.966,363.572,360.978z"></path></svg></div>

<div id="invert" class="toolbarIcon" title="Invert Graph [I]"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 16 L6 12 L14 12 Z" fill="#ff8d40"/><line x1="4" y1="10" x2="16" y2="10" stroke="#004d80" stroke-width="2"/><path d="M10 4 L6 8 L14 8 Z" fill="#004d80" opacity="0.7"/><path d="M2 8 L2 12" stroke="#004d80" stroke-width="1.5" stroke-linecap="round"/><path d="M18 12 L18 8" stroke="#004d80" stroke-width="1.5" stroke-linecap="round"/></svg></div>

@apangin apangin Jul 11, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This icon looks more like a splitter. IMO it will be better without side vertical lines and with a bit larger triangles.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/res/flame.html Outdated

<div class="title-toolbar-container">
<div class="left-toolbar">
<div id="graph-info" class="toolbarIcon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="8" stroke="#004d80" stroke-width="1" fill="none"/><path d="M10 5.5C8.75 5.5 7.75 6.5 7.75 7.75H9C9 7.06 9.56 6.5 10.25 6.5C10.94 6.5 11.5 7.06 11.5 7.75C11.5 8.4 10.95 8.75 10.5 8.95C9.8 9.3 9.25 9.8 9.25 10.75V11H10.75V10.75C10.75 10.38 11.04 10.1 11.43 9.92C12.16 9.58 12.75 9.05 12.75 7.75C12.75 6.5 11.25 5.5 10 5.5Z" fill="#ff8d40" stroke="#ff8d40" stroke-width="0.6" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="13.5" r="1" fill="#ff8d40"/></svg></div>

@apangin apangin Jul 11, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

WDYT about changing order of icons to match previous layout? E.g., Invert button first, then Search, and Help in the end.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/res/flame.html Outdated
if (devicePixelRatio) c.scale(devicePixelRatio, devicePixelRatio);
c.font = document.body.style.font;

function positionTooltip(e) {

@apangin apangin Jul 11, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Does it even need to float? Static position will be more than enough. It should make code simpler.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Jul 15, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

"Need" is a strong word for a UI choice. Made it static anyway.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/res/flame.html Outdated

btnInvert.onclick = function(e) {
invertMode();
e.preventDefault();

@apangin apangin Jul 11, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why is it needed? Is there a default behavior for onclick at all?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Jul 15, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This was to help with Chrome selecting title on double-click, doing some cleanup.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/res/flame.html Outdated
Comment on lines +569 to +570
e.preventDefault();
e.stopPropagation();

@apangin apangin Jul 11, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This repeats in several places. Doesn't return false have the same effect?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/res/flame.html Outdated
window.scroll(0, inverted ? root.level * 16 : canvasHeight - (root.level + 1) * 16);
canvas.onmousemove();
} else if(event.ctrlKey || event.metaKey) {
switch(event.key) {

@apangin apangin Jul 11, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Rewriting the function with two switch statements did not make it any cleaner or more readable. On the contrary, this excessively increased nesting level. IMO, switches do not make sense here, especially with one label only.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Jul 15, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

There used to be more cases. switch makes it clearer as opposed to composite if-conditions. Converting to if chain.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@krk
address comments
22af25b
@apangin

apangin commented Jul 15, 2025

Copy link
Copy Markdown
Collaborator

After pressing 0:
0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apangin

apangin commented Jul 15, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

It's very unobvious what "Highlight" and "Hide frame" menu items do when popup menu is opened on an empty space of a flamegraph.

I also realized that I feel frustrated when a webpage does not allow me to open the default popup menu by replacing it with a custom popup. Highlighting frame type is a funny feature, but I'm not sure its value outweighs the price

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@krk

krk commented Jul 16, 2025

Copy link
Copy Markdown
Contributor Author

You could do Shift + Right Click to get the browser's context menu. Additionally, I will fix so only frames will have the custom context menu.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@krk

krk commented Jul 16, 2025

Copy link
Copy Markdown
Contributor Author

After pressing 0:

Fixed too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk added 2 commits July 16, 2025 09:18
@krk
address comments
a3499bc
@krk
Remove context menu
ca74efd
@krk

krk commented Jul 18, 2025

Copy link
Copy Markdown
Contributor Author

Context menu feature removed based on offline discussions.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk added 3 commits September 10, 2025 13:44
@krk
Reconvert outdated flamegraph.html
2296dae
@krk
Merge branch 'master' into flamegraph-legend
5366fb1
@krk
Merge remote-tracking branch 'upstream/master' into flamegraph-legend
ed2a011
@krk krk mentioned this pull request Sep 25, 2025
Fix the pixel jump on hovering the flamegraph, on Firefox and Chrome #1511
Closed
krk added 2 commits October 1, 2025 15:00
@krk
Merge remote-tracking branch 'upstream/master' into flamegraph-legend
95130c4
@krk
revert margin changes for top-level elements
51836a3
@krk

krk commented Oct 13, 2025

Copy link
Copy Markdown
Contributor Author

Unrelated test failure:

FAIL [105/119] RecoveryTests.suppliers took 8.972 s
java.lang.AssertionError: Expected 0.002007024586051179 < 0.002
	>  test/test/recovery/RecoveryTests.java:80
	>  Assert.isLess(out.ratio("unknown|break_compiled"), 0.002);
	at one.profiler.test.Assert.assertComparison(Assert.java:39)
	at one.profiler.test.Assert.isLess(Assert.java:76)
	at test.recovery.RecoveryTests.suppliers(RecoveryTests.java:80)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at one.profiler.test.Runner.run(Runner.java:124)
	at one.profiler.test.Runner.main(Runner.java:188)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@krk
Merge remote-tracking branch 'upstream/master' into flamegraph-legend
7eae496
apangin
apangin reviewed Jan 11, 2026
View reviewed changes
Comment thread .assets/html/flamegraph.html Outdated
align-items: center;
flex-grow: 1;
}
.toolbar-section {

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Unused?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread .assets/html/flamegraph.html Outdated
Comment on lines +61 to +72
.top {
border-top: .1px solid #000
}
.left {
border-left: .1px solid #000
}
.bottom {
border-bottom: .1px solid #000
}
.right {
border-right: .1px solid #000
}

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't see usages of these classes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread .assets/html/flamegraph.html Outdated
align-items: center;
cursor: pointer;
}
.toolbarSelected {

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Unused?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread .assets/html/flamegraph.html Outdated
.right {
border-right: .1px solid #000
}
.toolbarIcon {

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Inconsistent naming style: some classes use camelCase, but some use kebab-case.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread .assets/html/flamegraph.html Outdated
Shift + N - Focus on previous match<br>
Esc - Cancel search<br>
<br>
I - invert graph<br>

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Invert (uppercase)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread .assets/html/flamegraph.html Outdated
</div>
</div>

<div class='bordered' style="display: flex; flex-direction: column;">

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What are these styles for?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .assets/html/flamegraph.html
Comment on lines +428 to +434
btnInfo.onmousedown = function() {
return false;
};

btnInfo.ondblclick = function(e) {
return false;
}

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Somewhere function() and somewhere function(e)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread .assets/html/flamegraph.html Outdated
} else if ((event.key === 'n' || event.key === 'N') && nav.length > 0) {
} else if((event.ctrlKey || event.metaKey) && event.key === 'f') {
search(true);
} else if (event.key === 'n' && nav.length > 0) {

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

event.key === 'N' was essential for Shift+N to work.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread .assets/html/flamegraph.html Outdated
} else if (event.key === '0') {
resetZoom();
}
return false;

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why is that? Standard combinations like reload (Ctrl+R), Zoom (Ctrl+, Ctrl-) etc. no longer work.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@krk krk Jan 13, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Moved return false to only handled combinations. For example when Ctrl+F is pressed, search popup is shown. Without return false, browser search is also activated.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
apangin
apangin reviewed Jan 11, 2026
View reviewed changes
Comment thread .assets/images/flamegraph.png

@apangin apangin Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

How come new image is smaller but its size on disk is 240% bigger?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@krk krk Jan 13, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Took a new screenshot and ran it through optipng. Previous image looks like it was scaled up. If I have to hypothesize, I could say previous image had less entropy because of the scaling, hence more compressible.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@apangin

apangin commented Jan 11, 2026

Copy link
Copy Markdown
Collaborator

There is something wrong with the layout of "Produced by async-profiler" text (Latest Chrome, Windows 11):

layout
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apangin

apangin commented Jan 12, 2026

Copy link
Copy Markdown
Collaborator

I did some modifications: https://profiler.tools/tmp/flamegraph-legend.html
What do you think of this version?

shakuzen and krk reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk added 3 commits January 13, 2026 11:57
@krk
Merge branch 'master' into flamegraph-legend
6128798
@krk
address comments
2a2b970
@krk
address comments
30261ae
@krk

krk commented Jan 13, 2026

Copy link
Copy Markdown
Contributor Author

There is something wrong with the layout of "Produced by async-profiler" text (Latest Chrome, Windows 11):

Cannot repro this on latest Chrome + Ubuntu 24. Added text-wrap-mode: nowrap to .right-section in any case.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@krk
add new lines for the new linter
3329785
apangin added a commit that referenced this pull request Jan 13, 2026
@apangin @krk
#1140: Flamegraph improvements: legend, hot keys, new toolbar icons
0b73f65
Co-authored-by: Kerem Kat <[email protected]>
apangin added a commit that referenced this pull request Jan 13, 2026
@apangin @krk
#1140: Flamegraph hot keys should not trigger default browser action
16fdebf
Co-authored-by: Kerem Kat <[email protected]>
@apangin

apangin commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator

Integrated with some modifications.

krk reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apangin apangin closed this Jan 13, 2026
@apangin apangin mentioned this pull request Jan 13, 2026
Generate color key for flame graph #379
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@apangin apangin apangin left review comments
+1 more reviewer
@marcelocenerine marcelocenerine marcelocenerine left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@krk @roy-soumadipta @simonis @apangin @marcelocenerine
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.