| 1 | package packageurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.18 testing/" |
| 5 | ) |
| 6 | |
| 7 | // Sample purls of varying complexity |
| 8 | var ( |
| 9 | simplePurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/simplePurl. = "pkg:npm/[email protected]" |
| 10 | namespacePurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/namespacePurl. = "pkg:maven/org.apache.commons/[email protected]" |
| 11 | qualifiersPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/qualifiersPurl. = "pkg:npm/%40angular/[email protected]?repository_url=https://registry.npmjs.org" |
| 12 | complexPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/complexPurl. = "pkg:rpm/fedora/[email protected]?arch=i386&distro=fedora-25&repository_url=http://example.com" |
| 13 | subpathPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/subpathPurl. = "pkg:github/package-url/purl-spec@244fd47e07d1004f0aed9c#src/main/java" |
| 14 | fullPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/fullPurl. = "pkg:deb/debian/[email protected]?arch=amd64&distro=stretch&repository_url=http://deb.debian.org#subpath/to/file" |
| 15 | ) |
| 16 | |
| 17 | // Pre-parsed PackageURL structs for ToString benchmarks |
| 18 | var ( |
| 19 | simplePackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/simplePackageURL. = PackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#{ |
| 20 | Typescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Type.: "npm", |
| 21 | Namescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Name.: "lodash", |
| 22 | Versionscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Version.: "4.17.21", |
| 23 | } |
| 24 | namespacePackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/namespacePackageURL. = PackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#{ |
| 25 | Typescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Type.: "maven", |
| 26 | Namespacescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Namespace.: "org.apache.commons", |
| 27 | Namescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Name.: "commons-lang3", |
| 28 | Versionscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Version.: "3.12.0", |
| 29 | } |
| 30 | qualifiersPackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/qualifiersPackageURL. = PackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#{ |
| 31 | Typescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Type.: "npm", |
| 32 | Namespacescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Namespace.: "@angular", |
| 33 | Namescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Name.: "core", |
| 34 | Versionscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Version.: "16.0.0", |
| 35 | Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Qualifiers.: Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#{ |
| 36 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "repository_url", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "https://registry.npmjs.org"}, |
| 37 | }, |
| 38 | } |
| 39 | complexPackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/complexPackageURL. = PackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#{ |
| 40 | Typescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Type.: "rpm", |
| 41 | Namespacescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Namespace.: "fedora", |
| 42 | Namescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Name.: "curl", |
| 43 | Versionscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Version.: "7.50.3-1.fc25", |
| 44 | Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Qualifiers.: Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#{ |
| 45 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "arch", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "i386"}, |
| 46 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "distro", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "fedora-25"}, |
| 47 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "repository_url", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "http://example.com"}, |
| 48 | }, |
| 49 | } |
| 50 | fullPackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/fullPackageURL. = PackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#{ |
| 51 | Typescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Type.: "deb", |
| 52 | Namespacescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Namespace.: "debian", |
| 53 | Namescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Name.: "dpkg", |
| 54 | Versionscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Version.: "1.19.0.4", |
| 55 | Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Qualifiers.: Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#{ |
| 56 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "arch", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "amd64"}, |
| 57 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "distro", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "stretch"}, |
| 58 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "repository_url", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "http://deb.debian.org"}, |
| 59 | }, |
| 60 | Subpathscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Subpath.: "subpath/to/file", |
| 61 | } |
| 62 | ) |
| 63 | |
| 64 | // FromString benchmarks - parsing |
| 65 | func BenchmarkFromString_Simplescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkFromString_Simple().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 66 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 67 | _, _ = FromStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/FromString().(simplePurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/simplePurl.) |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func BenchmarkFromString_Namespacescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkFromString_Namespace().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 72 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 73 | _, _ = FromStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/FromString().(namespacePurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/namespacePurl.) |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | func BenchmarkFromString_Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkFromString_Qualifiers().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 78 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 79 | _, _ = FromStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/FromString().(qualifiersPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/qualifiersPurl.) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func BenchmarkFromString_Complexscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkFromString_Complex().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 84 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 85 | _, _ = FromStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/FromString().(complexPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/complexPurl.) |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | func BenchmarkFromString_Subpathscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkFromString_Subpath().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 90 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 91 | _, _ = FromStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/FromString().(subpathPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/subpathPurl.) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func BenchmarkFromString_Fullscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkFromString_Full().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 96 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 97 | _, _ = FromStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/FromString().(fullPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/fullPurl.) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | // ToString benchmarks - serialization |
| 102 | func BenchmarkToString_Simplescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkToString_Simple().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 103 | p := simplePackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/simplePackageURL. |
| 104 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 105 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 106 | _ = p.ToStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#ToString().() |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func BenchmarkToString_Namespacescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkToString_Namespace().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 111 | p := namespacePackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/namespacePackageURL. |
| 112 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 113 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 114 | _ = p.ToStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#ToString().() |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | func BenchmarkToString_Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkToString_Qualifiers().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 119 | p := qualifiersPackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/qualifiersPackageURL. |
| 120 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 121 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 122 | _ = p.ToStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#ToString().() |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | func BenchmarkToString_Complexscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkToString_Complex().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 127 | p := complexPackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/complexPackageURL. |
| 128 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 129 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 130 | _ = p.ToStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#ToString().() |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | func BenchmarkToString_Fullscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkToString_Full().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 135 | p := fullPackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/fullPackageURL. |
| 136 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 137 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 138 | _ = p.ToStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#ToString().() |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // Normalize benchmarks |
| 143 | func BenchmarkNormalize_Simplescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkNormalize_Simple().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 144 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 145 | p := simplePackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/simplePackageURL. |
| 146 | _ = p.Normalizescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Normalize().() |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | func BenchmarkNormalize_Complexscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkNormalize_Complex().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 151 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 152 | p := complexPackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/complexPackageURL. |
| 153 | _ = p.Normalizescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Normalize().() |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | func BenchmarkNormalize_Fullscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkNormalize_Full().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 158 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 159 | p := fullPackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/fullPackageURL. |
| 160 | _ = p.Normalizescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Normalize().() |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | // Roundtrip benchmarks (parse + serialize) |
| 165 | func BenchmarkRoundtrip_Simplescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkRoundtrip_Simple().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 166 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 167 | p, _ := FromStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/FromString().(simplePurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/simplePurl.) |
| 168 | _ = p.ToStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#ToString().() |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | func BenchmarkRoundtrip_Complexscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkRoundtrip_Complex().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 173 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 174 | p, _ := FromStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/FromString().(complexPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/complexPurl.) |
| 175 | _ = p.ToStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#ToString().() |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | func BenchmarkRoundtrip_Fullscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkRoundtrip_Full().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 180 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 181 | p, _ := FromStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/FromString().(fullPurlscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/fullPurl.) |
| 182 | _ = p.ToStringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#ToString().() |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | // Qualifier operations |
| 187 | func BenchmarkQualifiersFromMap_Smallscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkQualifiersFromMap_Small().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 188 | m := map[string]string{ |
| 189 | "arch": "amd64", |
| 190 | } |
| 191 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 192 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 193 | _ = QualifiersFromMapscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/QualifiersFromMap().(m) |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | func BenchmarkQualifiersFromMap_Mediumscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkQualifiersFromMap_Medium().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 198 | m := map[string]string{ |
| 199 | "arch": "amd64", |
| 200 | "distro": "debian-10", |
| 201 | "repository_url": "http://example.com", |
| 202 | } |
| 203 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 204 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 205 | _ = QualifiersFromMapscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/QualifiersFromMap().(m) |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | func BenchmarkQualifiersFromMap_Largescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkQualifiersFromMap_Large().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 210 | m := map[string]string{ |
| 211 | "arch": "amd64", |
| 212 | "distro": "debian-10", |
| 213 | "repository_url": "http://example.com", |
| 214 | "checksum": "sha256:abc123", |
| 215 | "vcs_url": "git+https://github.com/foo/bar", |
| 216 | "download_url": "https://example.com/download", |
| 217 | } |
| 218 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 219 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 220 | _ = QualifiersFromMapscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/QualifiersFromMap().(m) |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | func BenchmarkQualifiers_Map_Smallscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkQualifiers_Map_Small().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 225 | q := Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#{{Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "arch", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "amd64"}} |
| 226 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 227 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 228 | _ = q.Mapscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#Map().() |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | func BenchmarkQualifiers_Map_Mediumscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkQualifiers_Map_Medium().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 233 | q := Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#{ |
| 234 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "arch", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "amd64"}, |
| 235 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "distro", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "debian-10"}, |
| 236 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "repository_url", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "http://example.com"}, |
| 237 | } |
| 238 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 239 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 240 | _ = q.Mapscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#Map().() |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | func BenchmarkQualifiers_Map_Largescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkQualifiers_Map_Large().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 245 | q := Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#{ |
| 246 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "arch", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "amd64"}, |
| 247 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "distro", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "debian-10"}, |
| 248 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "repository_url", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "http://example.com"}, |
| 249 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "checksum", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "sha256:abc123"}, |
| 250 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "vcs_url", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "git+https://github.com/foo/bar"}, |
| 251 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "download_url", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "https://example.com/download"}, |
| 252 | } |
| 253 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 254 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 255 | _ = q.Mapscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#Map().() |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | // Qualifier String/Normalize |
| 260 | func BenchmarkQualifiers_Stringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkQualifiers_String().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 261 | q := complexPackageURLscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/complexPackageURL..Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/PackageURL#Qualifiers. |
| 262 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 263 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 264 | _ = q.Stringscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#String().() |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | func BenchmarkQualifiers_Normalizescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkQualifiers_Normalize().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 269 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 270 | q := Qualifiersscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#{ |
| 271 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "Arch", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "amd64"}, |
| 272 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "DISTRO", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "debian-10"}, |
| 273 | {Keyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Key.: "repository_url", Valuescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifier#Value.: "http://example.com"}, |
| 274 | } |
| 275 | _ = q.Normalizescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/Qualifiers#Normalize().() |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | // Validation benchmarks |
| 280 | func BenchmarkValidQualifierKeyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkValidQualifierKey().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 281 | keys := []string{"arch", "repository_url", "vcs_url", "checksum.sha256"} |
| 282 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 283 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 284 | for _, k := range keys { |
| 285 | _ = validQualifierKeyscip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/validQualifierKey().(k) |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | func BenchmarkValidTypescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/BenchmarkValidType().(b *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Bscip-go gomod github.com/golang/go/src go1.18 testing/B#) { |
| 291 | types := []string{"npm", "maven", "pypi", "golang", "deb", "rpm"} |
| 292 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.18 testing/B#ResetTimer().() |
| 293 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.18 testing/B#N.; i++ { |
| 294 | for _, t := range types { |
| 295 | _ = validTypescip-go gomod github.com/package-url/packageurl-go . `github.com/package-url/packageurl-go`/validType().(t) |
| 296 | } |
| 297 | } |
| 298 | } |