Skip to content

Commit 402a225

Browse files
StevenACoffmansbalabanov-zz
andauthoredNov 13, 2021
Optimize performance for binder, imports and packages (Rebased from sbalabanov/master) (99designs#1711)
* Cache go.mod resolution for module name search * Optimize binder.FindObject() for performance by eliminating repeatitive constructs * Optimize allocations in packages.Load() function * Optimize binder.FindObject() by indexing object definitions for each loaded package * goimports to fix linting Signed-off-by: Steve Coffman <[email protected]> Co-authored-by: Sergey Balabanov <[email protected]>
1 parent 237a7e6 commit 402a225

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+225
-160
lines changed
 

‎api/option_test.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import (
1111
"github.com/stretchr/testify/require"
1212
)
1313

14-
type testPlugin struct {
15-
}
14+
type testPlugin struct{}
1615

1716
// Name returns the plugin name
1817
func (t *testPlugin) Name() string {
@@ -25,7 +24,6 @@ func (t *testPlugin) MutateConfig(_ *config.Config) error {
2524
}
2625

2726
func TestReplacePlugin(t *testing.T) {
28-
2927
t.Run("replace plugin if exists", func(t *testing.T) {
3028
pg := []plugin.Plugin{
3129
federation.New(),
@@ -54,5 +52,4 @@ func TestReplacePlugin(t *testing.T) {
5452
require.EqualValues(t, resolvergen.New(), pg[1])
5553
require.EqualValues(t, expectedPlugin, pg[2])
5654
})
57-
5855
}

‎client/websocket.go

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ func (p *Client) WebsocketWithPayload(query string, initPayload map[string]inter
6464
srv := httptest.NewServer(p.h)
6565
host := strings.ReplaceAll(srv.URL, "http://", "ws://")
6666
c, _, err := websocket.DefaultDialer.Dial(host+r.URL.Path, r.Header)
67-
6867
if err != nil {
6968
return errorSubscription(fmt.Errorf("dial: %w", err))
7069
}

0 commit comments

Comments
 (0)
Please sign in to comment.