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

Avoid two statics for every callsite #921

Open
Mark-Simulacrum opened this issue Aug 12, 2020 · 0 comments
Open

Avoid two statics for every callsite #921

Mark-Simulacrum opened this issue Aug 12, 2020 · 0 comments
Labels
crate/tracing Related to the `tracing` crate kind/perf Performance improvements

Comments

@Mark-Simulacrum
Copy link

Enhancement

Motivation

Currently tracing generates two statics: META and CALLSITE for every callsite. It seems likely that this has a higher cost at codegen and (potentially) runtime than just one static, as it's adding to the amount of symbols in the binary, etc.

That said, we don't have actual measurements that say "this is concretely bad" :)

Proposal

Probably the easiest thing is to try and refactor the code such that the macro-generated static is just static F: (&Metadata<'static>, Callsite) = (..., ...); -- but maybe there's better alternatives than that.

@hawkw hawkw added crate/tracing Related to the `tracing` crate kind/perf Performance improvements labels Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/tracing Related to the `tracing` crate kind/perf Performance improvements
Projects
None yet
Development

No branches or pull requests

2 participants