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

Cache demangling step #483

Closed
r1viollet opened this issue Jan 16, 2024 · 5 comments
Closed

Cache demangling step #483

r1viollet opened this issue Jan 16, 2024 · 5 comments

Comments

@r1viollet
Copy link
Contributor

Context

The demangling step is done on the fly after retrieving the symbols from the cache.
This implies extra CPU costs when requesting demangled symbols.

Proposed solution

Add a demangled symbol entry within the caching structure.

@danielocfb
Copy link
Collaborator

I am unsure about this one, to be honest. Yes, there could be some CPU gains to be had, but memory overhead is potentially close to unbounded. I haven't heard of anybody caching demangling results (though that doesn't have to mean much).

Given that the demangling is basically the last step of symbolization, could you built that on top instead? I.e., instruct blazesym to not demangle and then demangle yourself based on a cache. That, or longer term we could perhaps come up with some plug-in caching scheme, where you'd be able to configure the Symbolizer at creation time.

@r1viollet
Copy link
Contributor Author

Agreed.
This is what I did for now and it was OK. The docs around demangling options could maybe mention this.

Thanks for considering. Great library, simple APIs!

@r1viollet
Copy link
Contributor Author

Proposal for an extra line in the comment over the APIs

    /// The demangling step is not cached (this can have impacts
    /// on performances).

@d-e-s-o
Copy link
Collaborator

d-e-s-o commented Jan 17, 2024

Good point. Will incorporate your suggestion. Thanks!

d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jan 17, 2024
Add a note to the Symbolizer type that it currently does not cache
demangling results.

Refs: libbpf#483
d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jan 17, 2024
Add a note to the Symbolizer type that it currently does not cache
demangling results.

Refs: libbpf#483

Signed-off-by: Daniel Müller <deso@posteo.net>
danielocfb pushed a commit that referenced this issue Jan 17, 2024
Add a note to the Symbolizer type that it currently does not cache
demangling results.

Refs: #483

Signed-off-by: Daniel Müller <deso@posteo.net>
@r1viollet
Copy link
Contributor Author

Thanks! Closing for now as the caching step is not essential.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants