|
20 | 20 | sys.path.append(os.getcwd())
|
21 | 21 |
|
22 | 22 | from performance.reference.block_index import from_blocks
|
| 23 | +from performance.reference.block_index import indices_to_contiguous_pairs |
23 | 24 |
|
24 | 25 |
|
25 | 26 |
|
@@ -130,73 +131,73 @@ def __call__(self):
|
130 | 131 |
|
131 | 132 |
|
132 | 133 | class BlockIndexIterIntArray(ArrayProcessor):
|
133 |
| - NAME = 'BlockIndex: iter by int array' |
| 134 | + NAME = 'BlockIndex: contig by int array' |
134 | 135 | SORT = 5
|
135 | 136 |
|
136 | 137 | def __call__(self):
|
137 |
| - _ = list(self.bi.iter_select(self.selector_int_array)) |
| 138 | + _ = list(self.bi.iter_contiguous(self.selector_int_array)) |
138 | 139 |
|
139 | 140 | class TupleIndexIterIntArray(ArrayProcessor):
|
140 |
| - NAME = 'TupleIndex: iter by int array' |
| 141 | + NAME = 'TupleIndex: contig by int array' |
141 | 142 | SORT = 15
|
142 | 143 |
|
143 | 144 | def __call__(self):
|
144 | 145 | ti = self.ti
|
145 |
| - _ = [ti[i] for i in self.selector_int_array] |
| 146 | + _ = list(indices_to_contiguous_pairs(ti[i] for i in self.selector_int_array)) |
146 | 147 |
|
147 | 148 |
|
148 | 149 | class BlockIndexIterIntList(ArrayProcessor):
|
149 |
| - NAME = 'BlockIndex: iter by int list' |
| 150 | + NAME = 'BlockIndex: contig by int list' |
150 | 151 | SORT = 6
|
151 | 152 |
|
152 | 153 | def __call__(self):
|
153 |
| - _ = list(self.bi.iter_select(self.selector_int_list)) |
| 154 | + _ = list(self.bi.iter_contiguous(self.selector_int_list)) |
154 | 155 |
|
155 | 156 | class TupleIndexIterIntList(ArrayProcessor):
|
156 |
| - NAME = 'TupleIndex: iter by int list' |
| 157 | + NAME = 'TupleIndex: contig by int list' |
157 | 158 | SORT = 16
|
158 | 159 |
|
159 | 160 | def __call__(self):
|
160 | 161 | ti = self.ti
|
161 |
| - _ = [ti[i] for i in self.selector_int_list] |
| 162 | + _ = list(indices_to_contiguous_pairs(ti[i] for i in self.selector_int_list)) |
162 | 163 |
|
163 | 164 |
|
164 | 165 | class BlockIndexIterSlice(ArrayProcessor):
|
165 |
| - NAME = 'BlockIndex: iter by slice' |
| 166 | + NAME = 'BlockIndex: contig by slice' |
166 | 167 | SORT = 7
|
167 | 168 |
|
168 | 169 | def __call__(self):
|
169 |
| - _ = list(self.bi.iter_select(self.selector_slice)) |
| 170 | + _ = list(self.bi.iter_contiguous(self.selector_slice)) |
170 | 171 |
|
171 | 172 | class TupleIndexIterSlice(ArrayProcessor):
|
172 |
| - NAME = 'TupleIndex: iter by slice' |
| 173 | + NAME = 'TupleIndex: contig by slice' |
173 | 174 | SORT = 17
|
174 | 175 |
|
175 | 176 | def __call__(self):
|
176 | 177 | ti = self.ti
|
177 |
| - _ = list(iter(ti[self.selector_slice])) |
| 178 | + _ = list(indices_to_contiguous_pairs(ti[self.selector_slice])) |
178 | 179 |
|
179 | 180 |
|
180 | 181 |
|
181 | 182 |
|
182 | 183 | class BlockIndexIterBoolArray(ArrayProcessor):
|
183 |
| - NAME = 'BlockIndex: iter by bool array' |
| 184 | + NAME = 'BlockIndex: contig by bool array' |
184 | 185 | SORT = 8
|
185 | 186 |
|
186 | 187 | def __call__(self):
|
187 |
| - _ = list(self.bi.iter_select(self.selector_bool_array)) |
| 188 | + _ = list(self.bi.iter_contiguous(self.selector_bool_array)) |
188 | 189 |
|
189 | 190 | class TupleIndexIterBoolArray(ArrayProcessor):
|
190 |
| - NAME = 'TupleIndex: iter by bool array' |
| 191 | + NAME = 'TupleIndex: contig by bool array' |
191 | 192 | SORT = 18
|
192 | 193 |
|
193 | 194 | def __call__(self):
|
194 | 195 | ti = self.ti
|
195 |
| - _ = [ti[i] for i, b in enumerate(self.selector_bool_array) if b] |
| 196 | + _ = list(indices_to_contiguous_pairs(ti[i] for i, b in enumerate(self.selector_bool_array) if b)) |
196 | 197 |
|
197 | 198 |
|
198 | 199 | #-------------------------------------------------------------------------------
|
199 |
| -NUMBER = 5 |
| 200 | +NUMBER = 50 |
200 | 201 |
|
201 | 202 | def seconds_to_display(seconds: float) -> str:
|
202 | 203 | seconds /= NUMBER
|
|
0 commit comments