SIGN IN SIGN UP

opentelemetry-sdk: remove copy on span instantiation (#5272)

* opentelemetry-sdk: remove copy on span instantiation

This copy isn't necessary as the init method of the BoundedAttributes (inside the span's init method) already iterates through and copies all the attributes in a new Dict. Ran some benchmarks before and after the change with:

```
pytest opentelemetry-sdk/benchmarks/trace/test_benchmark_trace.py::test_start_span_with_attributes \
  --memray --trace-python-allocators --benchmark-disable -v
```

The following table shows the before and after change savings:

| attrs | Before (KiB) | After (KiB) | Saved (KiB) |
|------:|-------------:|------------:|------------:|
| 0     | 7.5          | 7.3         | 0.2         |
| 1     | 8.3          | 8.1         | 0.2         |
| 10    | 11.3         | 11.3        | 0.0         |
| 50    | 15.8         | 14.3        | 1.5         |
| 128   | 28.0         | 24.8        | 3.2         |

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>

* add changelog

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
A
Alex Boten committed
effa3dde0d45daba8ff52be4698091f7b0d04587
Parent: ed622c3
Committed by GitHub <noreply@github.com> on 6/4/2026, 3:05:00 PM