You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(otel): eliminate redundant clones and pre-allocate in trace flattening
Remove a redundant full-depth clone of JSON maps in `process_resource_spans`
by consuming the vector instead of borrowing, allowing direct moves into
`Value::Object`. Additionally, refactor `flatten_attributes` and
`insert_json_from_value` to pass protobuf values by reference, preventing
deep clones of nested arrays and KvLists before serde conversion. Add
capacity hints to Vec and Map initializations based on known payload lengths.
Profiling (143 requests, ~597k span records):
- Hotpath total time: 57.10s → 43.67s (23.5% faster)
- Hotpath P95 latency: 742.39ms → 489.68ms (34.0% faster)
- Total allocations: 12.2 GB → 8.4 GB (31.1% reduction)
- `process_resource_spans` CPU: 5.49% → 2.22% (56.0% reduction)
0 commit comments