microsoftgraph / msgraph-sdk-go

Microsoft Graph SDK for Go
https://docs.microsoft.com/en-us/graph/sdks/sdks-overview
MIT License
231 stars 34 forks source link

importing "github.com/microsoftgraph/msgraph-sdk-go" adds 10 seconds to build time #753

Closed quinn closed 4 weeks ago

quinn commented 1 month ago

Describe the bug

Adding this package took my build time from around 1 second to 10 to 20 seconds.

Expected behavior

I would expect adding a new dependency to only make a marginal difference on build time.

Is there a way to only include the graph libraries that I will be using?

How to reproduce

main.go:

package main

import (
    "fmt"

    msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
)

type Repo struct {
    msgraph *msgraphsdk.GraphServiceClient
}

func main() {
    fmt.Println("%v", Repo{})
}
$ go mod init test
$ go mod tidy
$ time go build main.go
go build main.go  6.78s user 3.18s system 55% cpu 18.043 total

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ``` ```

Configuration

No response

Other information

No response

baywet commented 1 month ago

Hi @quinn, Thank you for using the sdk and for reaching out. We just had a very similar question a couple of days ago so I thought I would link you to the answer I provided back then. https://github.com/microsoftgraph/msgraph-sdk-java/issues/2098#issuecomment-2255773250 Let us know if you have any additional question.

microsoft-github-policy-service[bot] commented 1 month ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.