-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance improvements for attribute value
AsStringSlice
, `AsFloa…
…t64Slice`, `AsInt64Slice`, `AsBoolSlice` (#6011) Good day, This PR changes As[Bool|Int64|Float64|String]Slice to use a little less reflection. The benchstat result of this is as follows. ``` goos: linux goarch: amd64 pkg: go.opentelemetry.io/otel/internal/attribute cpu: AMD Ryzen 7 Pro 7735U with Radeon Graphics │ org.txt │ new.txt │ │ sec/op │ sec/op vs base │ AsFloat64Slice-16 373.3n ± 41% 181.0n ± 42% -51.51% (p=0.000 n=10) │ org.txt │ new.txt │ │ B/op │ B/op vs base │ AsFloat64Slice-16 64.00 ± 0% 40.00 ± 0% -37.50% (p=0.000 n=10) │ org.txt │ new.txt │ │ allocs/op │ allocs/op vs base │ AsFloat64Slice-16 3.000 ± 0% 2.000 ± 0% -33.33% (p=0.000 n=10) ``` --------- Co-authored-by: Damien Mathieu <42@dmathieu.com>
- Loading branch information
1 parent
09105a9
commit 9f82e51
Showing
3 changed files
with
31 additions
and
24 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
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
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