-
Notifications
You must be signed in to change notification settings - Fork 1k
Too many wrapper objects? #1314
Copy link
Copy link
Closed
Labels
APIAPI related issuesAPI related issuesFeature RequestSuggest an idea for this projectSuggest an idea for this projectpriority:p1Critical issues and bugs. Highest priority; breaking API changes.Critical issues and bugs. Highest priority; breaking API changes.release:required-for-gaRequired for 1.0 GA releaseRequired for 1.0 GA release
Description
Activity
Metadata
Metadata
Assignees
Labels
APIAPI related issuesAPI related issuesFeature RequestSuggest an idea for this projectSuggest an idea for this projectpriority:p1Critical issues and bugs. Highest priority; breaking API changes.Critical issues and bugs. Highest priority; breaking API changes.release:required-for-gaRequired for 1.0 GA releaseRequired for 1.0 GA release
Is your feature request related to a problem? Please describe.
Currently there are many wrapper objects like
TraceId,SpanId. In other languages these may be cheap but in Java, allocations do affect app performance and instrumentation needs to take efforts to reduce the burden on an app. Lately there's some buzz on the interwebs about this topic folks may have seen :)Describe the solution you'd like
These are mostly attributes of a span's context. It seems like
SpanContextcould store the values like the long IDs directly and provide any needed helpers like hex encoding.Has this been given any thought? I found this but it doesn't seem to provide concrete motivation for wrappers.
#12
SpanIdseems particularly aggregious, it's effectively just aLong.https://github.com/open-telemetry/opentelemetry-java/blob/master/api/src/main/java/io/opentelemetry/trace/SpanId.java
Consider how much effort JVMs have put in to avoiding boxing as much as possible, it seems a bit weird to me that we are boxing everything by default.