From bcd7bcc2968d1db4d4eb16c50afa76bdcffb6302 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Wed, 21 Aug 2019 20:05:22 +0200 Subject: prog: speed up resource ctors detection When we build a list of resource constructors we over and over iterate through all types in a syscall to find resource types. Speed it up by iterating only once to build a list of constructors for each resource and then reuse it. This significantly speeds up syz-exeprog startup time on Raspberry Pi Zero. --- prog/decl_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prog/decl_test.go') diff --git a/prog/decl_test.go b/prog/decl_test.go index bf6bec4d1..f999ae589 100644 --- a/prog/decl_test.go +++ b/prog/decl_test.go @@ -15,7 +15,7 @@ func TestResourceCtors(t *testing.T) { testEachTarget(t, func(t *testing.T, target *Target) { expectFail := false for _, res := range target.Resources { - if len(target.calcResourceCtors(res.Kind, true)) == 0 != expectFail { + if len(target.calcResourceCtors(res, true)) == 0 != expectFail { t.Errorf("resource %v can't be created", res.Name) } } -- cgit mrf-deployment