This repository has been archived by the owner on Nov 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
Datadog surfacer makes cloudprober binary too big #628
Comments
I've a change that fixes this. I'll submit it tomorrow. |
manugarg
added a commit
that referenced
this issue
Jul 20, 2021
This change brings binary size back to 52M (from 61M). We need only 1% of the datadog API client's functionality and using it increases binary size by 17% to 22% (Ref: #628). I believe this is happening because in datadog API client library, basic symbols like APIClient or Configuration refer to a lot of other symbols[1]. This means that even after compilation and linking, almost all the symbols become part of the generated binary. I've verified that surfacer continues to work after this change. [1] - https://github.com/DataDog/datadog-api-client-go/blob/5c76e2376ad3d1ceba0eb1199bf9447808e88948/api/v1/datadog/client.go#L43 PiperOrigin-RevId: 385683900
manugarg
added a commit
that referenced
this issue
Jul 20, 2021
This change brings binary size back to 52M (from 61M). We need only 1% of the datadog API client's functionality and using it increases binary size by 17% to 22% (Ref: #628). I believe this is happening because in datadog API client library, basic symbols like APIClient or Configuration refer to a lot of other symbols[1]. This means that even after compilation and linking, almost all the symbols become part of the generated binary. I've verified that surfacer continues to work after this change. [1] - https://github.com/DataDog/datadog-api-client-go/blob/5c76e2376ad3d1ceba0eb1199bf9447808e88948/api/v1/datadog/client.go#L43 PiperOrigin-RevId: 385683900
manugarg
added a commit
that referenced
this issue
Jul 20, 2021
This change brings binary size back to 52M (from 61M). We need only 1% of the datadog API client's functionality and using it increases binary size by 17% to 22% (Ref: #628). I believe this is happening because in datadog API client library, basic symbols like APIClient or Configuration refer to a lot of other symbols[1]. This means that even after compilation and linking, almost all the symbols become part of the generated binary. I've verified that surfacer continues to work after this change. [1] - https://github.com/DataDog/datadog-api-client-go/blob/5c76e2376ad3d1ceba0eb1199bf9447808e88948/api/v1/datadog/client.go#L43 PiperOrigin-RevId: 385683900
manugarg
added a commit
that referenced
this issue
Jul 20, 2021
This change brings binary size back to 52M (from 61M). We need only 1% of the datadog API client's functionality and using it increases binary size by 17% to 22% (Ref: #628). I believe this is happening because in datadog API client library, basic symbols like APIClient or Configuration refer to a lot of other symbols[1]. This means that even after compilation and linking, almost all the symbols become part of the generated binary. I've verified that surfacer continues to work after this change. [1] - https://github.com/DataDog/datadog-api-client-go/blob/5c76e2376ad3d1ceba0eb1199bf9447808e88948/api/v1/datadog/client.go#L43 PiperOrigin-RevId: 385683900
Binary size is back to 14.3 MB zipped, 43.8 MB unzipped. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Datadog surfacer, added in #627, makes cloudprober binary size go from 35.7 MB to 43.7 MB (zipped 14.3 MB to 16.5 MB), that's more than 22% (15% for zipped version) increase in binary size, just for one surfacer. I believe this is due to monolithic datadog API package. We should look at avoiding the library package and using the HTTP REST API directly.
CC: @c6h12o6
The text was updated successfully, but these errors were encountered: