Skip to content
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

perf: zap library leaking into binaries #1242

Open
ayuhito opened this issue May 11, 2024 · 1 comment
Open

perf: zap library leaking into binaries #1242

ayuhito opened this issue May 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ayuhito
Copy link

ayuhito commented May 11, 2024

What version of ogen are you using?

v1.1.0

Can this issue be reproduced with the latest version?

Yes

What did you do?

This is an extremely minor bug, but it's worth noting down if anyone wants to look into it.

I ran gsa on my API binaries when I noticed that zap was being imported into my project. I think it's leaking into the API binaries via the ogen/jsonschema library (not sure) and adding ~40kb to all binaries if you do not use zap.

r.Logger = zap.NewNop()

It's not high priority, but I think any optimizations like this will help in resource constrained environments.

What did you expect to see?

zap should not be present in the library.

What did you see instead?

image

@ayuhito ayuhito added the bug Something isn't working label May 11, 2024
@tdakkota
Copy link
Member

It seems that generated code imports github.com/ogen-go/ogen/middleware

"github.com/ogen-go/ogen/middleware"

github.com/ogen-go/ogen/middleware imports github.com/ogen-go/ogen/openapi

"github.com/ogen-go/ogen/openapi"

github.com/ogen-go/ogen/openapi imports github.com/ogen-go/ogen/jsonschema

"github.com/ogen-go/ogen/jsonschema"

Not sure if we can fix it without breaking v1 compatibility.

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

2 participants