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

Reduce string allocations where possible #506

Merged
merged 1 commit into from Mar 31, 2021
Merged

Reduce string allocations where possible #506

merged 1 commit into from Mar 31, 2021

Conversation

jtescher
Copy link
Member

Reduce string allocations where static strs can be used and only clone resources if they are set.

performance improvements
start-end-span/always-sample
                        time:   [420.87 ns 424.12 ns 427.52 ns]
                        change: [-28.404% -27.348% -26.230%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
start-end-span/never-sample
                        time:   [150.86 ns 151.45 ns 152.08 ns]
                        change: [-35.664% -33.873% -32.391%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) high mild
  1 (1.00%) high severe

start-end-span-4-attrs/always-sample
                        time:   [1.9644 us 1.9784 us 1.9936 us]
                        change: [-17.564% -16.436% -15.363%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
start-end-span-4-attrs/never-sample
                        time:   [190.61 ns 191.81 ns 193.05 ns]
                        change: [-27.437% -26.276% -24.883%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
  6 (6.00%) high mild
  7 (7.00%) high severe

start-end-span-8-attrs/always-sample
                        time:   [3.4251 us 3.4545 us 3.4851 us]
                        change: [-12.269% -10.913% -9.5738%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild
start-end-span-8-attrs/never-sample
                        time:   [228.22 ns 229.16 ns 230.13 ns]
                        change: [-25.206% -24.434% -23.704%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild

start-end-span-all-attr-types/always-sample
                        time:   [2.6734 us 2.6973 us 2.7247 us]
                        change: [-12.791% -11.390% -10.077%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) low mild
  4 (4.00%) high mild
  2 (2.00%) high severe
start-end-span-all-attr-types/never-sample
                        time:   [202.75 ns 203.76 ns 204.82 ns]
                        change: [-27.168% -26.470% -25.712%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) low mild
  4 (4.00%) high mild
  2 (2.00%) high severe

start-end-span-all-attr-types-2x/always-sample
                        time:   [3.9943 us 4.0204 us 4.0470 us]
                        change: [-11.299% -9.8533% -8.5633%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe
start-end-span-all-attr-types-2x/never-sample
                        time:   [266.36 ns 269.42 ns 272.70 ns]
                        change: [-18.999% -17.821% -16.498%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  3 (3.00%) high mild
  4 (4.00%) high severe

@jtescher jtescher requested a review from a team as a code owner March 31, 2021 20:08
Copy link
Member

@frigus02 frigus02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I think this even makes APIs like Tracer::start a bit nicer to use because you can pass in both &str and String directly.

Copy link
Contributor

@TommyCpp TommyCpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement 👍

@jtescher jtescher merged commit a0b80e8 into main Mar 31, 2021
@jtescher jtescher deleted the allocations branch March 31, 2021 20:56
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

Successfully merging this pull request may close these issues.

None yet

3 participants