forked from tokio-rs/tracing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opentelemetry: improve performance by pre-determining attribute length (
tokio-rs#1327) The `SpanBuilder` uses `Vec` to store span's fields. However, the current solution can be slightly improved by preparing the capacity of `Vec` in advance, this can reduce a few memory reallocations. Since the max number of tracing's span fields is 32, we can replace `Vec` with `SmallVec` to further improve performance. Maybe, we should add a new feature (such as `smallvec`?) to the `opentelemetry` crate. Well, this should be discussed in the `opentelemetry` repo. Co-authored-by: Eliza Weisman <eliza@buoyant.io>
- Loading branch information
Showing
1 changed file
with
16 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters