clj-async-profiler icon indicating copy to clipboard operation
clj-async-profiler copied to clipboard

Feature request: default sorting by name

Open tonsky opened this issue 1 year ago • 1 comments

I feel sorting by name gives you more stable ordering, making it easier to see the changes between two or more runs. I would be happy if it was the default sorting, but if that’s not possible, maybe make it an option to select in overview page and all the graph will open with respect to that option?

Screenshot 2024-10-17 at 14 56 38

tonsky avatar Oct 17 '24 12:10 tonsky

I personally find the width sorting much easier for navigation. It allows me to not squint trying to find the most impactful subtree – I know for sure that the widest frames are on the left.

That being said, I'm working on a solution that allows to save this option (among other things) into either the in-memory state of the profiler or bake it into the final HTML. There are a few rough edges to smooth out, so it will either make it into 1.4.0 or one of the subsequent minor releases.

alexander-yakushev avatar Oct 17 '24 16:10 alexander-yakushev

With 1.5.0 release, you can do the following:

(clj-async-profiler.core/set-default-profiling-options {:config {:sort-by :name}})

If you put it into user.clj or a global user.clj, then all generated flamegraphs will be sorted by name by default.

Alternatively, once you generate a flamegraph, open it in the web UI, change the sorting order to Name and press Save config (a newly added button), then the future flamegraphs within the same process will be generated with that Name sorting by default.

Does this fulfill your request?

alexander-yakushev avatar Nov 20 '24 16:11 alexander-yakushev

Yes! Thank you!

tonsky avatar Nov 21 '24 11:11 tonsky