cuelang.org/go@v0.13.0/cue/testdata/benchmarks/disjunctelim.txtar (about) 1 // TODO: make special benchmark test that tests repeated lines more accurately 2 // and and automatically. 3 4 -- in.cue -- 5 // Should linearly increase with each repeated line. 6 // automatically. 7 pat: {[string]: 1} | {a: 2} // 9 conjuncts 8 pat: {[string]: 1} | {a: 2} // 23 conjuncts (+14) 9 pat: {[string]: 1} | {a: 2} // 34 conjuncts (+11) 10 pat: {[string]: 1} | {a: 2} // 45 conjuncts (+11) 11 pat: {[string]: 1} | {a: 2} // 56 conjuncts (+11) 12 pat: {[string]: 1} | {a: 2} // 67 conjuncts (+11) 13 pat: {[string]: 1} | {a: 2} // 78 conjuncts (+11) 14 pat: {[string]: 1} | {a: 2} // 89 conjuncts (+11) 15 pat: {[string]: 1} | {a: 2} // 100 conjuncts (+11) 16 pat: {[string]: 1} | {a: 2} // 111 conjuncts (+11) 17 18 // This also should grow linearly per repeated line. 19 // Indicated 20 list: [1] | [2] | [3] | [4] // 19 conjuncts; 4 disjuncts 21 list: [1] | [2] | [3] | [4] // 52 conjuncts; 20 disjuncts (+33; +16) 22 list: [1] | [2] | [3] | [4] // 85 conjuncts; 36 disjuncts (+33; +16) 23 list: [1] | [2] | [3] | [4] // 118 conjuncts; 52 disjuncts (+33; +16) 24 list: [1] | [2] | [3] | [4] // 151 conjuncts; 68 disjuncts (+33; +16) 25 list: [1] | [2] | [3] | [4] // 184 conjuncts; 84 disjuncts (+33; +16) 26 list: [1] | [2] | [3] | [4] // 217 conjuncts; 100 disjuncts (+33; +16) 27 28 issue3610: { 29 // Ensure disjuncts are disambiguated. The string field here is a reference 30 // and causes a task to be added. Ensure that, for instance, disjuncts 31 // >"b" and (>"b" & string) get equated when at least the task has 32 // completed. 33 #a 34 #a: <"a" | >"b" | string 35 #a: <"a" | >"b" | string // conjuncts 127 disjuncts 120 36 #a: <"a" | >"b" | string // conjuncts 219 disjuncts 210 (+92; +90) 37 #a: <"a" | >"b" | string // conjuncts 311 disjuncts 300 (+92; +90) 38 #a: <"a" | >"b" | string // conjuncts 403 disjuncts 390 (+92; +90) 39 #a: <"a" | >"b" | string // conjuncts 495 disjuncts 480 (+92; +90) 40 } 41 42 -- out/evalalpha/stats -- 43 Leaks: 802 44 Freed: 0 45 Reused: 0 46 Allocs: 802 47 Retain: 0 48 49 Unifications: 22 50 Conjuncts: 843 51 Disjuncts: 618 52 53 CloseIDElems: 49 54 NumCloseIDs: 4 55 -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 56 diff old new 57 --- old 58 +++ new 59 @@ -1,9 +1,12 @@ 60 -Leaks: 0 61 -Freed: 367 62 -Reused: 356 63 -Allocs: 11 64 +Leaks: 802 65 +Freed: 0 66 +Reused: 0 67 +Allocs: 802 68 Retain: 0 69 70 -Unifications: 133 71 -Conjuncts: 866 72 -Disjuncts: 367 73 +Unifications: 22 74 +Conjuncts: 843 75 +Disjuncts: 618 76 + 77 +CloseIDElems: 49 78 +NumCloseIDs: 4 79 -- out/eval/stats -- 80 Leaks: 0 81 Freed: 367 82 Reused: 356 83 Allocs: 11 84 Retain: 0 85 86 Unifications: 133 87 Conjuncts: 866 88 Disjuncts: 367 89 -- out/eval -- 90 (struct){ 91 pat: (struct){ |((struct){ 92 }, (struct){ 93 a: (int){ 2 } 94 }) } 95 list: (list){ |((#list){ 96 0: (int){ 1 } 97 }, (#list){ 98 0: (int){ 2 } 99 }, (#list){ 100 0: (int){ 3 } 101 }, (#list){ 102 0: (int){ 4 } 103 }) } 104 issue3610: (string){ |((string){ 105 <"a" 106 #a: (string){ |((string){ <"a" }, (string){ >"b" }, (string){ string }) } 107 }, (string){ 108 >"b" 109 #a: (string){ |((string){ <"a" }, (string){ >"b" }, (string){ string }) } 110 }, (string){ 111 string 112 #a: (string){ |((string){ <"a" }, (string){ >"b" }, (string){ string }) } 113 }) } 114 } 115 -- out/compile -- 116 --- in.cue 117 { 118 pat: ({ 119 [string]: 1 120 }|{ 121 a: 2 122 }) 123 pat: ({ 124 [string]: 1 125 }|{ 126 a: 2 127 }) 128 pat: ({ 129 [string]: 1 130 }|{ 131 a: 2 132 }) 133 pat: ({ 134 [string]: 1 135 }|{ 136 a: 2 137 }) 138 pat: ({ 139 [string]: 1 140 }|{ 141 a: 2 142 }) 143 pat: ({ 144 [string]: 1 145 }|{ 146 a: 2 147 }) 148 pat: ({ 149 [string]: 1 150 }|{ 151 a: 2 152 }) 153 pat: ({ 154 [string]: 1 155 }|{ 156 a: 2 157 }) 158 pat: ({ 159 [string]: 1 160 }|{ 161 a: 2 162 }) 163 pat: ({ 164 [string]: 1 165 }|{ 166 a: 2 167 }) 168 list: ([ 169 1, 170 ]|[ 171 2, 172 ]|[ 173 3, 174 ]|[ 175 4, 176 ]) 177 list: ([ 178 1, 179 ]|[ 180 2, 181 ]|[ 182 3, 183 ]|[ 184 4, 185 ]) 186 list: ([ 187 1, 188 ]|[ 189 2, 190 ]|[ 191 3, 192 ]|[ 193 4, 194 ]) 195 list: ([ 196 1, 197 ]|[ 198 2, 199 ]|[ 200 3, 201 ]|[ 202 4, 203 ]) 204 list: ([ 205 1, 206 ]|[ 207 2, 208 ]|[ 209 3, 210 ]|[ 211 4, 212 ]) 213 list: ([ 214 1, 215 ]|[ 216 2, 217 ]|[ 218 3, 219 ]|[ 220 4, 221 ]) 222 list: ([ 223 1, 224 ]|[ 225 2, 226 ]|[ 227 3, 228 ]|[ 229 4, 230 ]) 231 issue3610: { 232 ć0;#ać 233 #a: (<"a"|>"b"|string) 234 #a: (<"a"|>"b"|string) 235 #a: (<"a"|>"b"|string) 236 #a: (<"a"|>"b"|string) 237 #a: (<"a"|>"b"|string) 238 #a: (<"a"|>"b"|string) 239 } 240 }