Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's not easy to get the names of functions that has namespaces / class names that are taking a lot of character space (e.g. due to generic parameters) #4944

Open
julienw opened this issue Mar 26, 2024 · 2 comments
Labels
call tree Related to the call tree panel flame graph Related to the flame graph panel polish Small features or changes that do not require planning to work on. These help out our end users. stack chart Issues related to the stack chart panel

Comments

@julienw
Copy link
Contributor

julienw commented Mar 26, 2024

example: https://profiler.firefox.com/public/2472k1k8y08jzryrcj1f60jsntaae0br7dax5ag/flame-graph/?globalTrackOrder=0w3&thread=3&v=10

function name: style::invalidation::element::invalidator::TreeStyleInvalidator::invalidate_child
function name with all types: style::invalidation::element::invalidator::TreeStyleInvalidator<style::gecko::wrapper::GeckoElement,style::invalidation::element::relative_selector::RelativeSelectorOuterInvalidationProcessor<style::gecko::wrapper::GeckoElement> >::invalidate_child<style::gecko::wrapper::GeckoElement,style::invalidation::element::relative_selector::RelativeSelectorOuterInvalidationProcessor<style::gecko::wrapper::GeckoElement> >(style::gecko::wrapper::GeckoElement, ref$<slice2$<style::invalidation::element::invalidator::Invalidation> >, smallvec::SmallVec<array$<style::invalidation::element::invalidator::Invalidation,10> >*, style::invalidation::element::invalidator::DescendantInvalidationKind) [servo/components/style/invalidation/element/invalidator.rs]

The only way I found to get the name for this function was to copy the function name from the context menu, and paste it elsewhere.

The problem is everywhere: call tree, flame graph, stack chart, tooltip.. but not the sidebar. Maybe a quick win would be to display just the function name in the tooltip. Possibly the opposite is better: display just the function name in the flame graph and stack chart, but the full name (non ellipsis-ed) in the tooltip.

Other ideas:
We should probably reduce the length of some generics. Ideas: remove the module name, replace the generics by ... after some depth. What are other tools doing?

┆Issue is synchronized with this Jira Task

@julienw julienw added polish Small features or changes that do not require planning to work on. These help out our end users. call tree Related to the call tree panel flame graph Related to the flame graph panel stack chart Issues related to the stack chart panel labels Mar 26, 2024
@mstange
Copy link
Contributor

mstange commented Mar 26, 2024

One way to rephrase that particular function would be:

style::invalidation::element::invalidator::TreeStyleInvalidator<A,B>::invalidate_child<A,B>(A, ref$<C>, smallvec::SmallVec<D>*, style::invalidation::element::invalidator::DescendantInvalidationKind) with A = style::gecko::wrapper::GeckoElement, B = style::invalidation::element::relative_selector::RelativeSelectorOuterInvalidationProcessor<A>, C = slice2$<E>, D = array$<E,10>, E = style::invalidation::element::invalidator::Invalidation

This issue has previously come up in #1468 - that particular issue was fixed by excluding return types from the symbol names. But we have the same issue for "scope names" / "class names" with generic parameters.

@mstange mstange changed the title It's not easy to get the names of functions that has return types that are taking a lot of character space It's not easy to get the names of functions that has namespaces / class names that are taking a lot of character space (e.g. due to generic parameters) Mar 26, 2024
@julienw
Copy link
Contributor Author

julienw commented Mar 27, 2024

style::invalidation::element::invalidator::TreeStyleInvalidator<A,B>:: is still pretty long as a prefix; I wonder if we should remove that (or part of that) for the text to show in the graphs' boxes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
call tree Related to the call tree panel flame graph Related to the flame graph panel polish Small features or changes that do not require planning to work on. These help out our end users. stack chart Issues related to the stack chart panel
Projects
None yet
Development

No branches or pull requests

2 participants