1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-14 02:33:21 +02:00
opentelemetry-go/sdk/trace
Warnar Boekkooi 3cbd967152
Performance improvements for recordingSpan SetAttributes and addOverCapAttrs (#5864)
Good day,

While working on
https://github.com/open-telemetry/opentelemetry-go/pull/5858 I found
some other possible improvements.

This PR:
- Adds an early return to `SetAttributes` when no attributes are
provided.
- Only increases `s.attributes` to guarantee that there is enough space
for elements to be added.
- Fixes and issue where `truncateAttr` was not used when a attribute was
being updated in `addOverCapAttrs`.

Thanks for reviewing and please let me know if any changes are needed.

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
2024-10-07 09:30:29 +02:00
..
tracetest [chore]: enable len and empty rules from testifylint (#5832) 2024-09-21 08:04:28 -07:00
batch_span_processor_test.go Refactor Batch Processor benchmark to really test OnEnd (#5600) 2024-07-16 09:22:04 +02:00
batch_span_processor.go Fix timer channel drain to avoid hanging in Go 1.23 (#5869) 2024-10-04 09:48:57 +02:00
benchmark_test.go Add unparam linter (#5531) 2024-06-21 16:02:07 -07:00
doc.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
event.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
evictedqueue_test.go trace: Use non-generic to replace newEvictedQueue in trace.start to reduce memory usage. (#5497) 2024-06-17 07:39:03 -07:00
evictedqueue.go trace: Use non-generic to replace newEvictedQueue in trace.start to reduce memory usage. (#5497) 2024-06-17 07:39:03 -07:00
id_generator_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
id_generator.go Fix IDGenerator may generate zero TraceId / SpanId (#5514) 2024-06-18 15:57:45 -07:00
link.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
provider_test.go [chore]: enable error-nil rule from testifylint (#5843) 2024-09-25 11:07:59 +02:00
provider.go Add errorlint linter (#5535) 2024-06-25 10:55:00 -07:00
README.md Add READMEs to every package (#5103) 2024-03-26 20:13:54 +01:00
sampler_env.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
sampling_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
sampling.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
simple_span_processor_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
simple_span_processor.go sdk/trace: fix spelling errors (#4996) 2024-03-25 13:10:08 +01:00
snapshot.go Allow relying on InstrumentationScope in SpanStub and fix remaining deprecation issues (#5627) 2024-07-24 09:33:07 +02:00
span_exporter.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
span_limits_test.go [chore]: enable len and empty rules from testifylint (#5832) 2024-09-21 08:04:28 -07:00
span_limits.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
span_processor_annotator_example_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
span_processor_filter_example_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
span_processor_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
span_processor.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
span_test.go Split the span start/end benchmarks and test start with links and attributes (#5554) 2024-06-28 11:51:09 +02:00
span.go Performance improvements for recordingSpan SetAttributes and addOverCapAttrs (#5864) 2024-10-07 09:30:29 +02:00
trace_test.go [chore]: enable expected-actual rule from testifylint (#5848) 2024-09-26 12:04:33 +02:00
tracer.go trace: Use non-generic to replace newEvictedQueue in trace.start to reduce memory usage. (#5497) 2024-06-17 07:39:03 -07:00
util_test.go Add unparam linter (#5531) 2024-06-21 16:02:07 -07:00
version_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
version.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00

SDK Trace

PkgGoDev