Skip to content

replace json-iterator/go with reflection-free dependency to reenable dead code elimination #12747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kruskall opened this issue Mar 26, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@kruskall
Copy link

Component(s)

pdata

What happened?

Describe the bug

any binary that depends on go.opentelemetry.io/collector/pdata has DCE (dead code elimination) disabled due to a dependency on https://github.com/json-iterator/go

Any use of reflect.Value.MethodByName() or reflect.Type.MethodByName() disables DCE. The compiler assumes that these functions will look any method up, and cannot remove methods even if they are never called.

Steps to reproduce

build a binary that depends on go.opentelemetry.io/collector/pdata

What did you expect to see?

a small binary

What did you see instead?

a huge binary

Collector version

anything after #4986

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

Log output

Additional context

No response

@kruskall kruskall added the bug Something isn't working label Mar 26, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant