@@ -2,7 +2,7 @@ mod datasets_paths;
22mod utils;
33
44use criterion:: { criterion_group, criterion_main} ;
5- use milli:: update:: Settings ;
5+ use milli:: { update:: Settings , CriterionImplementationStrategy } ;
66use utils:: Conf ;
77
88#[ global_allocator]
@@ -81,6 +81,34 @@ fn bench_songs(c: &mut criterion::Criterion) {
8181 optional_words : false ,
8282 ..BASE_CONF
8383 } ,
84+ utils:: Conf {
85+ group_name : "proximity set-based" ,
86+ queries : & [
87+ "black saint sinner lady " ,
88+ "les dangeureuses 1960 " ,
89+ "The Disneyland Sing-Along Chorus " ,
90+ "Under Great Northern Lights " ,
91+ "7000 Danses Un Jour Dans Notre Vie " ,
92+ ] ,
93+ criterion : Some ( & [ "proximity" ] ) ,
94+ optional_words : false ,
95+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlySetBased ,
96+ ..BASE_CONF
97+ } ,
98+ utils:: Conf {
99+ group_name : "proximity iterative" ,
100+ queries : & [
101+ "black saint sinner lady " ,
102+ "les dangeureuses 1960 " ,
103+ "The Disneyland Sing-Along Chorus " ,
104+ "Under Great Northern Lights " ,
105+ "7000 Danses Un Jour Dans Notre Vie " ,
106+ ] ,
107+ criterion : Some ( & [ "proximity" ] ) ,
108+ optional_words : false ,
109+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlyIterative ,
110+ ..BASE_CONF
111+ } ,
84112 utils:: Conf {
85113 group_name : "typo" ,
86114 queries : & [
@@ -120,12 +148,35 @@ fn bench_songs(c: &mut criterion::Criterion) {
120148 criterion : Some ( & [ "released-timestamp:desc" ] ) ,
121149 ..BASE_CONF
122150 } ,
151+ utils:: Conf {
152+ group_name : "asc set-based" ,
153+ criterion : Some ( & [ "released-timestamp:desc" ] ) ,
154+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlySetBased ,
155+ ..BASE_CONF
156+ } ,
157+ utils:: Conf {
158+ group_name : "asc iterative" ,
159+ criterion : Some ( & [ "released-timestamp:desc" ] ) ,
160+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlyIterative ,
161+ ..BASE_CONF
162+ } ,
123163 utils:: Conf {
124164 group_name : "desc" ,
125165 criterion : Some ( & [ "released-timestamp:desc" ] ) ,
126166 ..BASE_CONF
127167 } ,
128-
168+ utils:: Conf {
169+ group_name : "desc set-based" ,
170+ criterion : Some ( & [ "released-timestamp:desc" ] ) ,
171+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlySetBased ,
172+ ..BASE_CONF
173+ } ,
174+ utils:: Conf {
175+ group_name : "desc iterative" ,
176+ criterion : Some ( & [ "released-timestamp:desc" ] ) ,
177+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlyIterative ,
178+ ..BASE_CONF
179+ } ,
129180 /* then we bench the asc and desc criterion on top of the default criterion */
130181 utils:: Conf {
131182 group_name : "asc + default" ,
@@ -154,6 +205,11 @@ fn bench_songs(c: &mut criterion::Criterion) {
154205 filter : Some ( "released-timestamp != 1262347200 AND (NOT (released-timestamp = 946728000)) AND (duration-float = 1 OR (duration-float 1.1 TO 1.5 AND released-timestamp > 315576000))" ) ,
155206 ..BASE_CONF
156207 } ,
208+ utils:: Conf {
209+ group_name : "big IN filter" ,
210+ filter : Some ( "NOT released-timestamp IN [-126230400, -1399075200, -160444800, -189388800, -220924800, -252460800, -283996800, -31536000, -347155200, -378691200, -473385600, -631152000, -694310400, -94694400, 0, 1000166400, 1009843200, 1041379200, 1070323200, 1072915200, 1075852800, 1078099200, 1088640000, 1096588800, 1099612800, 1104537600, 1121644800, 1136073600, 1150156800, 1159660800, 1162339200, 1167609600, 1171584000, 1183248000, 1184112000, 1190419200, 1199145600, 1203724800, 1204329600, 1216339200, 1228089600, 1230768000, 1233446400, 1247097600, 1247961600, 1252886400, 126230400, 1262304000, 1268956800, 1283212800, 1285027200, 1293840000, 1295913600, 1296518400, 1306886400, 1312156800, 1320105600, 1321228800, 1321660800, 1322179200, 1322438400, 1325376000, 1327536000, 1338336000, 1347840000, 1351728000, 1353801600, 1356048000, 1356998400, 1369440000, 1370044800, 1372636800, 1382572800, 1382659200, 1384905600, 1388534400, 1393804800, 1397260800, 1401148800, 1411948800, 1420070400, 1426377600, 1427846400, 1433116800, 1439078400, 1440028800, 1446336000, 1451606400, 1456704000, 1464739200, 1466899200, 1467676800, 1470355200, 1483228800, 1493942400, 1495756800, 1497484800, 1506816000, 1512432000, 1514764800, 1521158400, 1522972800, 1524182400, 1528416000, 1529539200, 1533859200, 1536105600, 1536278400, 1543622400, 1546300800, 1547164800, 1550188800, 1551398400, 1564704000, 1572566400, 157766400, 1577836800, 1585267200, 1587772800, 1597968000, 1601251200, 189302400, 220924800, 252460800, 283996800, 31536000, 315532800, 347155200, 378691200, 410227200, 436492800, 441763200, 473385600, 504921600, 536457600, 567993600, 599616000, 606009600, 63072000 63072000, 631152000, 662688000, 672192000, 694224000, 725846400, 738892800, 757382400, 788918400, 790128000, 797212800, 820454400, 852076800, 854755200, 864518400, 866592000, 868233600, 872121600, 883612800, 886291200, 893980800, 912470400, 915148800, 938736000, 946684800, 94694400, 959904000, 965088000, 978307200, 987033600]" ) ,
211+ ..BASE_CONF
212+ } ,
157213
158214 /* the we bench some global / normal search with all the default criterion in the default
159215 * order */
@@ -171,6 +227,16 @@ fn bench_songs(c: &mut criterion::Criterion) {
171227 . collect :: < Vec < & str > > ( ) ,
172228 ..BASE_CONF
173229 } ,
230+ utils:: Conf {
231+ group_name : "basic without quote set-based" ,
232+ queries : & BASE_CONF
233+ . queries
234+ . iter ( )
235+ . map ( |s| s. trim ( ) ) // we remove the space at the end of each request
236+ . collect :: < Vec < & str > > ( ) ,
237+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlySetBased ,
238+ ..BASE_CONF
239+ } ,
174240 utils:: Conf {
175241 group_name : "basic with quote" ,
176242 queries : basic_with_quote,
@@ -187,6 +253,83 @@ fn bench_songs(c: &mut criterion::Criterion) {
187253 ] ,
188254 ..BASE_CONF
189255 } ,
256+ utils:: Conf {
257+ group_name : "prefix search set-based" ,
258+ queries : & [
259+ "s" , // 500k+ results
260+ "a" , //
261+ "b" , //
262+ "i" , //
263+ "x" , // only 7k results
264+ ] ,
265+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlySetBased ,
266+ ..BASE_CONF
267+ } ,
268+ utils:: Conf {
269+ group_name : "prefix search iterative" ,
270+ queries : & [
271+ "s" , // 500k+ results
272+ "a" , //
273+ "b" , //
274+ "i" , //
275+ "x" , // only 7k results
276+ ] ,
277+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlyIterative ,
278+ ..BASE_CONF
279+ } ,
280+ utils:: Conf {
281+ group_name : "words + prefix search" ,
282+ queries : & [
283+ "Someone I l" ,
284+ "billie e" ,
285+ "billie ei" ,
286+ "i am getting o" ,
287+ "i am getting ol" ,
288+ "i am getting old" ,
289+ "prologue 1 a 1" ,
290+ "prologue 1 a 10"
291+ ] ,
292+ ..BASE_CONF
293+ } ,
294+ utils:: Conf {
295+ group_name : "words + prefix search set-based" ,
296+ queries : & [
297+ "Someone I l" ,
298+ "billie e" ,
299+ "billie ei" ,
300+ "i am getting o" ,
301+ "i am getting ol" ,
302+ "i am getting old" ,
303+ "prologue 1 a 1" ,
304+ "prologue 1 a 10"
305+ ] ,
306+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlySetBased ,
307+ ..BASE_CONF
308+ } ,
309+ utils:: Conf {
310+ group_name : "words + prefix search iterative" ,
311+ queries : & [
312+ "Someone I l" ,
313+ "billie e" ,
314+ "billie ei" ,
315+ "i am getting o" ,
316+ "i am getting ol" ,
317+ "i am getting old" ,
318+ "prologue 1 a 1" ,
319+ "prologue 1 a 10"
320+ ] ,
321+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlyIterative ,
322+ ..BASE_CONF
323+ } ,
324+ utils:: Conf {
325+ group_name : "large offset" ,
326+ queries : & [
327+ "rock and r" ,
328+ ] ,
329+ offset : Some ( 770 ) ,
330+ criterion_implementation_strategy : CriterionImplementationStrategy :: OnlyIterative ,
331+ ..BASE_CONF
332+ } ,
190333 ] ;
191334
192335 utils:: run_benches ( c, confs) ;
0 commit comments