Skip to content

Avoid two statics for every callsite #921

Open
@Mark-Simulacrum

Description

@Mark-Simulacrum

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate/tracingRelated to the `tracing` cratekind/perfPerformance improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions