Add print() argument to sort alphabetically#126
Conversation
|
That looks nice! I really think that this needs to be done from the web UI, though. |
|
Instead of alphabetical sorting, I think it would be helpful to sort by longest bar on top. I believe this is what the Data view does. It's helpful in that the things that are furthest to the left are also the most expensive (and therefore the first things to look at optimizing). |
|
Good idea. We now sort within rows by aggregated time. Given this change, I have changed the argument from To make it togglable from the UI we could generate upfront the two sorts of the data and send both to the JS side. It is possible that the implementation of the In the meantime should we change the default to |
|
I'd prefer to keep the default order the same... I think the change would be confusing for people, and I do think the ordered view is useful for understanding the connection between the flow of the program and performance. This is especially true when profiling complex code. When the GUI has an obvious toggle switch for it, then users will have the best of both worlds. |
|
Could we please try and wrap this PR and get it merged? I've already found the sorting useful in a couple of places. |
Closes #115
Adds new
print()argumentsortwhich can take"time"(historical sorting, the default) and"alphabetical"values. The default can be changed with theprofvis.sortglobal option. Sorting alphabetically produces the same sort of flamegraphs discussed in https://queue.acm.org/detail.cfm?id=2927301.Edit: The print argument is now
aggregate(takes a boolean) and the global option isprofvis.aggregate(idem).We might want to consider making this sorting the default as it makes it much more likely to merge the boxes within rows:
Ideally, would be togglable from the web UI. For convenience the sorting is implemented in R, but we could generate both data frames upfront.