/
nightlyBench.py
2313 lines (1914 loc) · 97.9 KB
/
nightlyBench.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import datetime
import glob
import os
import pickle
import pysftp
import random
import re
import shutil
import smtplib
import sys
import tarfile
import time
import traceback
import urllib.request
import runStoredFieldsBenchmark
import runFacetsBenchmark
# local imports:
import benchUtil
import constants
import competition
import stats
import blunders
import localconstants
"""
This script runs certain benchmarks, once per day, and generates graphs so we can see performance over time:
* Index all of wikipedia ~ 1 KB docs w/ 512 MB ram buffer
* Run NRT perf test on this index for 30 minutes (we only plot mean/stddev reopen time)
* Index all of wikipedia actual (~4 KB) docs w/ 512 MB ram buffer
* Index all of wikipedia ~ 1 KB docs, flushing by specific doc count to get 5 segs per level
* Run search test
"""
KNOWN_CHANGES = [
('2011-04-25',
'Switched to 240 GB OCZ Vertex III',
"""
Switched from a traditional spinning-magnets hard drive (Western Digital Caviar Green, 1TB) to a 240 GB <a href="http://www.ocztechnology.com/ocz-vertex-3-sata-iii-2-5-ssd.html">OCZ Vertex III SSD</a>; this change gave a small increase in indexing rate, drastically reduced variance on the NRT reopen time (NRT is IO intensive), and didn't affect query performance (which is expected since the postings are small enough to fit into the OS's IO cache.
"""),
('2011-05-02',
'LUCENE-3023: concurrent flushing (DocWriterPerThread)',
"""
Concurrent flushing, a major improvement to Lucene, was committed. Before this change, flushing a segment in IndexWriter was single-threaded and blocked all other indexing threads; after this change, each indexing thread flushes its own segment without blocking indexing of other threads. On highly concurrent hardware (the machine running these tests has 24 cores) this can result in a tremendous increase in Lucene\'s indexing throughput. See <a href="http://blog.mikemccandless.com/2011/05/265-indexing-speedup-with-lucenes.html">this post</a> for details.
<p> Some queries did get slower, because the index now has more segments. Unfortunately, the index produced by concurrent flushing will vary, night to night, in how many segments it contains, so this is a further source of noise in the search results."""),
('2011-05-06',
'Make search index consistent',
"""
Changed how I build the index used for searching, to only use one thread. This results in exactly the same index structure (same segments, same docs per segment) from night to night, to avoid the added noise from change B.
"""),
('2011-05-07',
'Change to 20 indexing threads (from 6), 350 MB RAM buffer (from 512)',
"""
Increased number of indexing threads from 6 to 20 and dropped the IndexWriter RAM buffer from 512 MB to 350 MB. See <a href="http://blog.mikemccandless.com/2011/05/265-indexing-speedup-with-lucenes.html">this post</a> for details.
"""),
('2011-05-11',
'Add TermQuery with sorting',
"""
Added TermQuery, sorting by date/time and title fields.
"""),
('2011-05-14',
'Add TermQuery with grouping',
"""
Added TermQuery, grouping by fields with 100, 10K, 1M unique values.
"""),
('2011-06-03',
'Add single-pass grouping',
"""
Added Term (bgroup) and Term (bgroup, 1pass) using the BlockGroupingCollector for grouping into 1M unique groups.
"""),
('2011-06-26',
'Use MemoryCodec for id field; switched to NRTCachingDirectory for NRT test',
'''
Switched to MemoryCodec for the primary-key 'id' field so that lookups (either for PKLookup test or for deletions during reopen in the NRT test) are fast, with no IO. Also switched to NRTCachingDirectory for the NRT test, so that small new segments are written only in RAM.
'''),
('2011-07-04',
'Switched from Java 1.6.0_21 to 1.6.0_26',
'''
Switched from Java 1.6.0_21 to 1.6.0_26
'''),
('2011-07-11',
'LUCENE-3233: arc array optimizations to FST',
'''
<a href="https://issues.apache.org/jira/browse/LUCENE-3233">LUCENE-3233</a>: fast SynonymFilter using an FST, including an optimization to the FST representation allowing array arcs even when some arcs have large outputs; this resulted in a good speedup for MemoryCodec, which also speeds up the primary key lookup performance.
'''),
('2011-07-22',
'LUCENE-3328: specialize code for AND of TermQuery',
'''
<a href="https://issues.apache.org/jira/browse/LUCENE-3328">LUCENE-3328</a>: If all clauses of a BooleanQuery are MUST and are TermQuery then create a specialized scorer for scoring this common case.
'''),
('2011-07-30',
'Switched back to Java 1.6.0_21 from 1.6.0_26',
'''
Switched back to Java 1.6.0_21 from 1.6.0_26 because _26 would sometimes deadlock threads.
'''),
('2011-08-20',
'LUCENE-3030: cutover to more efficient BlockTree terms dict',
'''
<a href="https://issues.apache.org/jira/browse/LUCENE-3030">LUCENE-3030</a>: cutover to more efficient BlockTree terms dict.
'''),
('2011-09-22',
'LUCENE-3215: sloppy PhraseQuery speedups',
'''
<a href="https://issues.apache.org/jira/browse/LUCENE-3215">LUCENE-3215</a>: more efficient scoring for sloppy PhraseQuery.
'''),
('2011-11-30',
'LUCENE-3584: make postings bulk API codec-private',
'''
<a href="https://issues.apache.org/jira/browse/LUCENE-3584">LUCENE-3584</a>: make postings bulk API codec-private
'''),
('2011-12-07',
'Switched to Java 1.7.0_01',
'Switched to Java 1.7.0_01'),
('2011-12-16',
'LUCENE-3648: JIT optimizations to Lucene40 DocsEnum',
'<a href="https://issues.apache.org/jira/browse/LUCENE-3648">LUCENE-3648</a>: JIT optimizations to Lucene40 DocsEnum'),
('2012-01-30',
'LUCENE-2858: Split IndexReader in AtomicReader and CompositeReader',
'<a href="https://issues.apache.org/jira/browse/LUCENE-2858">LUCENE-2858</a>: Split IndexReader in AtomicReader and CompositeReader'),
('2012-03-18',
'LUCENE-3738: Be consistent about negative vInt/vLong',
'<a href="https://issues.apache.org/jira/browse/LUCENE-3738">LUCENE-3738</a>: Be consistent about negative vInt/vLong'),
('2012-05-25',
'LUCENE-4062: new aligned packed-bits implementations',
'<a href="https://issues.apache.org/jira/browse/LUCENE-4062">LUCENE-4062</a>: new aligned packed-bits implementations'),
('2012-05-28',
'Disable Java\'s compressed OOPS, and LUCENE-4055: refactor SegmentInfos/FieldInfos',
'Disable Java\'s compressed OOPS (-XX:-UseCompressedOops), and <a href="https://issues.apache.org/jira/browse/LUCENE-4055">LUCENE-4055</a>: refactor SegmentInfos/FieldInfos'),
('2012-05-06',
'LUCENE-4024: FuzzyQuery never does edit distance > 2',
'<a href="https://issues.apache.org/jira/browse/LUCENE-4024">LUCENE-4024</a>: FuzzyQuery never does edit distance > 2'),
('2012-05-15',
'LUCENE-4024: (rev 1338668) fixed ob1 bug causing FuzzyQ(1) to be TermQuery',
'<a href="https://issues.apache.org/jira/browse/LUCENE-4024">LUCENE-4024</a>: (rev <a href="http://svn.apache.org/viewvc?view=revision&revision=1338668">1338668</a>) fixed ob1 bug causing FuzzyQ(1) to be TermQuery'),
('2012-06-02',
'Re-enable Java\'s compressed OOPS',
'Re-enable Java\'s compressed OOPS'),
('2012-06-06',
'Switched to Java 1.7.0_04',
'Switched to Java 1.7.0_04'),
('2012-06-26',
'Fixed silly performance bug in PKLookupTask.java',
'Fixed silly performance bug in PKLookupTask.java'),
('2012-10-06',
'Stopped overclocking the computer running benchmarks.',
'Stopped overclocking the computer running benchmarks.'),
('2012-10-15',
'LUCENE-4446: switch to BlockPostingsFormat',
'LUCENE-4446: switch to BlockPostingsFormat'),
('2012-12-10',
'LUCENE-4598: small optimizations to facet aggregation',
'LUCENE-4598: small optimizations to facet aggregation'),
('2013-01-11',
'LUCENE-4620: IntEncoder/Decoder bulk API',
'<a href="https://issues.apache.org/jira/browse/LUCENE-4620">LUCENE-4620</a>: IntEncoder/Decoder bulk API'),
('2013-01-17',
'Facet performance improvements',
'Facet performance improvements: LUCENE-4686, LUCENE-4620, LUCENE-4602'),
('2013-01-21',
'Facet performance improvements',
'Facet performance improvements: LUCENE-4600'),
('2013-01-24',
'Switched to NO_PARENTS faceting',
'Switched to NO_PARENTS faceting'),
('2013-02-07',
'DocValues improvements (LUCENE-4547) and facets API improvements (LUCENE-4757)',
'DocValues improvements (<a href="https://issues.apache.org/jira/browse/LUCENE-4547">LUCENE-4547</a>) and facets API improvements (<a href="https://issues.apache.org/jira/browse/LUCENE-4757">LUCENE-4757</a>)'),
('2013-02-12',
'LUCENE-4764: new Facet42DocValuesFormat for faster but more RAM-consuming DocValues',
'<a href="https://issues.apache.org/jira/browse/LUCENE-4764">LUCENE-4764</a>: new Facet42DocValuesFormat for faster but more RAM-consuming DocValues'),
('2013-02-22',
'LUCENE-4791: optimize ConjunctionTermScorer to use skipping on first term',
'<a href="https://issues.apache.org/jira/browse/LUCENE-4791">LUCENE-4791</a>: optimize ConjunctionTermScorer to use skipping on first term'),
('2013-03-14',
'LUCENE-4607: add DISI/Spans.cost',
'<a href="https://issues.apache.org/jira/browse/LUCENE-4607">LUCENE-4607</a>: add DISI/Spans.cost'),
('2013-05-03',
'LUCENE-4946: SorterTemplate',
'<a href="https://issues.apache.org/jira/browse/LUCENE-4946">LUCENE-4946</a>: SorterTemplate'),
('2013-06-20',
'LUCENE-5063: compress int and long FieldCache entries',
'<a href="https://issues.apache.org/jira/browse/LUCENE-5063">LUCENE-5063</a>: compress int and long FieldCache entries'),
('2013-07-31',
'LUCENE-5140: recover slowdown in span queries and exact phrase query',
'<a href="https://issues.apache.org/jira/browse/LUCENE-5140">LUCENE-5140</a>: recover slowdown in span queries and exact phrase query'),
('2013-09-10',
'Switched to Java 1.7.0_40',
'Switched to Java 1.7.0_40'),
('2013-11-09',
'Switched to DirectDocValuesFormat for the Date facets field.',
'Switched to DirectDocValuesFormat for the Date facets field.'),
('2014-02-06',
'LUCENE-5425: performance improvement for FixedBitSet.iterator',
'<a href="https://issues.apache.org/jira/browse/LUCENE-5425">LUCENE-5425: performance improvement for FixedBitSet.iterator</a>',),
('2014-04-05',
'LUCENE-5527: LeafCollector (made CachingCollector slower)',
'<a href="https://issues.apache.org/jira/browse/LUCENE-5527">LUCENE-527: LeafCollector (made CachingCollector slower)</a>',),
('2014-04-25',
'Upgraded to Ubuntu 14.04 LTS (kernel 3.13.0-32-generic #57)',
'Upgraded to Ubuntu 14.04 LTS (kernel 3.13.0-32-generic #57)'),
('2014-06-10',
'Switched from DirectDVFormat to Lucene\'s default for Date facet field',
'Switched from DirectDVFormat to Lucene\'s default for Date facet field'),
('2014-07-25',
'Disabled transparent huge pages',
'Disabled transparent huge pages'),
('2014-08-30',
'Re-enabled transparent huge pages',
'Re-enabled transparent huge pages'),
('2014-03-11',
'LUCENE-5487: add BulkScorer',
'<a href="https://issues.apache.org/jira/browse/LUCENE-5487">LUCENE-5487: add BulkScorer</a>'),
('2014-11-01',
'LUCENE-6030: norms compression',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6030">LUCENE-6030: norms compression</a>'),
('2014-11-22',
'Upgrade from java 1.7.0_55-b13 to java 1.8.0_20-ea-b05',
'Upgrade from java 1.7.0_55-b13 to java 1.8.0_20-ea-b05'),
('2015-01-15',
'LUCENE-6179: remove out-of-order scoring',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6179">LUCENE-6179: remove out-of-order scoring</a>'),
('2015-01-19',
'LUCENE-6184: BooleanScorer better deals with sparse clauses',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6184">LUCENE-6184: BooleanScorer better deals with sparse clauses</a>'),
('2015-02-13',
'LUCENE-6198: Two phase intersection',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6198">LUCENE-6198: Two phase intersection</a> (approximations are not needed by any query in this benchmark, but the change refactored ConjunctionScorer a bit)'),
('2015-02-23',
'LUCENE-6275: SloppyPhraseScorer reuses ConjunctionDISI',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6275">LUCENE-6275: SloppyPhraseScorer reuses ConjunctionDISI</a>'),
('2015-03-02',
'LUCENE-6320: Speed up CheckIndex',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6320">LUCENE-6320: Speed up CheckIndex</a>'),
('2015-03-06',
'Upgrade JDK from 1.8.0_25-b17 to 1.8.0_40-b25',
'Upgrade JDK from 1.8.0_25-b17 to 1.8.0_40-b25'),
('2015-04-02',
'LUCENE-6308: span queries support two-phased iteration',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6308">LUCENE-6308: span queries support two-phased iteration</a>'),
('2015-04-04',
'LUCENE-5879: add auto-prefix terms',
'<a href="https://issues.apache.org/jira/browse/LUCENE-5879">LUCENE-5879: add auto-prefix terms</a>'),
('2015-06-24',
'LUCENE-6548: some optimizations to block tree intersect',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6548">LUCENE-6548: some optimizations to block tree intersect</a>'),
('2015-09-15',
'LUCENE-6789: switch to BM25 scoring by default',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6789">LUCENE-6789 switch to BM25 scoring by default</a>'),
('2015-10-05',
'Randomize what time of day benchmark runs',
'Randomize what time of day benchmark runs'),
('2015-12-02',
'Upgrade to beast2 (72 cores, 256 GB RAM)',
'Upgrade to beast2 (72 cores, 256 GB RAM)'),
('2015-12-10',
'LUCENE-6919: Change the Scorer API to expose an iterator instead of extending DocIdSetIterator',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6919">LUCENE-6919: Change the Scorer API to expose an iterator instead of extending DocIdSetIterator</a>'),
('2015-12-14',
'LUCENE-6917: Change from LegacyNumericRangeQuery to DimensionalRangeQuery',
'<a href="https://issues.apache.org/jira/browse/LUCENE-6917">LUCENE-6917: Change from LegacyNumericRangeQuery to DimensionalRangeQuery</a>'),
('2016-05-23',
'Fix silly benchmark bottlenecks; increase indexing heap to 8 GB; increase indexing buffer to 2 GB; increase indexing threads to 20; use default postings format for all fields; do not wait for commit in the end (just rollback); turn off merge IO throttling',
'<a href="https://github.com/mikemccand/luceneutil/commit/b24e28dd1bf9a9fcacd693c4162d5ebb03d4afe1">Fix silly benchmark bottlenecks and re-tune for high indexing throughput</a>'),
('2016-05-25',
'Fix another benchmark bottleneck for 1 KB docs (but this added a bug in TermDateFacets, fixed on 10/18)',
'Fix another benchmark bottleneck for 1 KB docs (but this added a bug in TermDateFacets, fixed on 10/18)'),
('2016-06-13',
'LUCENE-7330: Speed up conjunctions',
'<a href="https://issues.apache.org/jira/browse/LUCENE-7330">LUCENE-7330: Speed up conjunctions</a>'),
('2016-07-11',
'Upgrade beast2 OS from Ubuntu 15.04 to 16.04',
'Upgrade beast2 OS from Ubuntu 15.04 to 16.04'),
('2016-07-16',
'Upgrade beast2 kernel from 4.4.x to 4.6.x',
'Upgrade beast2 kernel from 4.4.x to 4.6.x'),
('2016-08-17',
'Upgrade beast2 kernel from 4.6.x to 4.7.0',
'Upgrade beast2 kernel from 4.6.x to 4.7.0'),
('2016-09-04',
'Upgrade beast2 kernel from 4.7.0 to 4.7.2',
'Upgrade beast2 kernel from 4.7.0 to 4.7.2'),
('2016-09-21',
'LUCENE-7407: Change doc values from random access to iterator API',
'LUCENE-7407: Change doc values from random access to iterator API',
),
('2016-10-18',
'Fix silly TermDateFacets bug causing single date facet to be indexed for all docs, added on 5/25',
'Fix silly TermDateFacets bug causing single date facet to be indexed for all docs, added on 5/25',
),
('2016-10-24',
'LUCENE-7462: give doc values an advanceExact API',
'LUCENE-7462: give doc values an advanceExact API',
),
('2016-10-26',
'LUCENE-7519: optimize computing browse-only facets, LUCENE-7489: Remove one layer of abstraction in binary doc values and single-valued numerics',
'LUCENE-7519: optimize computing browse-only facets, LUCENE-7489: Remove one layer of abstraction in binary doc values and single-valued numerics',
),
('2016-10-27',
'Re-enable transparent huge pages in Linux',
'Re-enable transparent huge pages in Linux',
),
('2016-10-31',
'LUCENE-7135: This issue accidentally caused FSDirectory.open to use NIOFSDirectory instead of MMapDirectory for e.g. CheckIndex',
'LUCENE-7135: This issue accidentally caused FSDirectory.open to use NIOFSDirectory instead of MMapDirectory for e.g. CheckIndex'),
('2016-11-02',
'LUCENE-7135: Fixed this issue so we use MMapDirectory again',
'LUCENE-7135: Fixed this issue so we use MMapDirectory again'),
('2017-01-18',
'LUCENE-7641: Speed up point ranges that match most documents',
'LUCENE-7641: Speed up point ranges that match most documents'),
('2017-10-27',
'LUCENE-7997: BM25 to use doubles instead of floats',
'LUCENE-7997: BM25 to use doubles instead of floats'),
('2018-01-31',
'LUCENE-4198: Allow codecs to index term impacts',
'LUCENE-4198: Allow codecs to index term impacts'),
('2018-02-20',
'LUCENE-8153: CheckIndex spends less time checking impacts',
'LUCENE-8153: CheckIndex spends less time checking impacts'),
('2018-05-02',
'LUCENE-8279: CheckIndex now cross-checks terms with norms',
'LUCENE-8279: CheckIndex now cross-checks terms with norms'),
('2018-05-11',
'Primary key now indexed with the default codec instead of the specialized Memory postings format',
'Primary key now indexed with the default codec instead of the specialized Memory postings format'),
('2018-05-25',
'LUCENE-8312: Leverage impacts for SynonymQuery (introduced regression for non-scoring term queries)',
'LUCENE-8312: Leverage impacts for SynonymQuery (introduced regression for non-scoring term queries)'),
('2018-08-07',
'LUCENE-8312: Fixed regression with non-scoring term queries',
'LUCENE-8312: Fixed regression with non-scoring term queries'),
('2018-08-07',
'LUCENE-8060: Stop counting total hits by default',
'LUCENE-8060: Stop counting total hits by default'),
('2018-08-18',
'LUCENE-8448: Propagate min competitive score to sub clauses',
'LUCENE-8448: Propagate min competitive score to sub clauses'),
('2018-11-19',
'LUCENE-8464: ConstantScoreScorer now implements setMinCompetitiveScore',
'LUCENE-8464: ConstantScoreScorer now implements setMinCompetitiveScore'),
('2019-04-23',
'Switched to OpenJDK 11',
'Switched to OpenJDK 11'),
('2019-04-30',
'Switched GC back to ParallelGC (away from default G1GC)',
'Switched GC back to ParallelGC (away from default G1GC)'),
('2019-05-06',
'LUCENE-8781: FST lookup performance has been improved in many cases by encoding Arcs using full-sized arrays with gaps',
'LUCENE-8781: FST lookup performance has been improved in many cases by encoding Arcs using full-sized arrays with gaps'),
('2019-05-24',
'LUCENE-8770: Two-phase support in conjunctions',
'LUCENE-8770: Two-phase support in conjunctions'),
('2019-07-02',
'LUCENE-8901: Load freq blocks lazily',
'LUCENE-8901: Load freq blocks lazily'),
('2019-07-09',
'LUCENE-8311: Compute impacts for phrase queries',
'LUCENE-8311: Compute impacts for phrase queries'),
('2019-09-26',
'LUCENE-8980: Blocktree seekExact now checks min-max range of the segment',
'LUCENE-8980: Blocktree seekExact now checks min-max range of the segment'),
('2019-10-14',
'LUCENE-8920: Disable direct addressing of arcs.',
'LUCENE-8920: Disable direct addressing of arcs.'),
('2019-11-14',
'LUCENE-8920: Re-enable direct addressing of arcs.',
'LUCENE-8920: Re-enable direct addressing of arcs.'),
('2019-11-19',
'LUCENE-9027: SIMD decompression of postings.',
'LUCENE-9027: SIMD decompression of postings.'),
('2019-11-21',
'LUCENE-9056: Fewer conditionals in #nextDoc/#advance',
'LUCENE-9056: Fewer conditionals in #nextDoc/#advance'),
('2020-01-13',
'Switch to OpenJDK 13',
'Switch to OpenJDK 13'),
('2020-01-14',
'Switch to OpenJDK 12',
'Switch to OpenJDK 12'),
('2020-01-17',
'Move invariant checks of CompetitiveImpactAccumulator under an assert',
'Move invariant checks of CompetitiveImpactAccumulator under an assert'),
('2020-01-24',
'LUCENE-4702: compress suffix bytes in terms dictionary',
'LUCENE-4702: compress suffix bytes in terms dictionary'),
('2020-02-18',
'LUCENE-9211: Adding compression to BinaryDocValues storage',
'LUCENE-9211: Adding compression to BinaryDocValues storage'),
('2020-09-09',
'LUCENE-9511: Include StoredFieldsWriter in DWPT accounting',
'LUCENE-9511: Include StoredFieldsWriter in DWPT accounting'),
('2020-10-27',
'LUCENE-9280: enable optimization to skip non-competitive documents when sorting by field by indexing benchmark datetime field as both points and doc values',
'LUCENE-9280: optimization to skip non-competitive documents when sorting by field by indexing benchmark datetime field as both points and doc values'),
('2020-11-06',
'Move to new beast 3 Ryzen Threadripper 3990X hardware for all nightly benchmarks',
'Move to new beast 3 Ryzen Threadripper 3990X hardware for all nightly benchmarks: 64 cores (128 with hyperthreading), 256 GB RAM, 960 GB Intel 905P Optane, Linux 5.9.2-arch1-1, still OpenJDK 12.0.2+10'),
('2020-11-14',
'LUCENE-9378: Configurable compression for binary doc values',
'LUCENE-9378: Configurable compression for binary doc values'),
('2020-12-04',
'Switch to JDK 15 (from JDK 12)',
'Switch to JDK 15 (from JDK 12)'),
('2020-12-09 10:00:13',
'Add KNN vectors to indexing metrics',
'Add KNN vectors to indexing metrics',),
('2020-12-10',
'LUCENE-9626: switch to native arrays for HNSW ANN vector search',
'LUCENE-9626: switch to native arrays for HNSW ANN vector search'),
('2020-12-28',
'LUCENE-9644: add diversity to HNSW (ANN search) neighbor selection, apparently yielding performance gains to VectorSearch task',
'LUCENE-9644: add diversity to HNSW (ANN search) neighbor selection, apparently yielding performance gains to VectorSearch task'),
('2021-01-09 13:35:50',
'increase max number of concurrent merges from 3 to 12 for indexing tasks; increase Indexer heap from 8 to 32 GB',
'increase max number of concurrent merges from 3 to 12 for indexing tasks; increase Indexer heap from 8 to 32 GB'),
('2021-01-07',
'LUCENE-9652: add dedicated method, DataInput.readLEFloats, to read float[] from DataInput, optimizing HNSW KNN',
'LUCENE-9652: add dedicated method, DataInput.readLEFloats, to read float[] from DataInput, optimizing HNSW KNN'),
('2021-01-24 17:25:07',
'enable BinaryDocValues compression in taxonomy index',
'enable BinaryDocValues compression in taxonomy index'),
('2021-01-28',
'LUCENE-9695: WTF somehow this bug fix hurt vector indexing throughput?',
'LUCENE-9695: WTF somehow this bug fix hurt vector indexing throughput?'),
('2021-02-25',
'Upgrade beast3 to Arch Linux 5.11.1',
'Upgrade beast3 to Arch Linux 5.11.1'),
('2021-03-14 08:23:12',
'Move vectors indexing to dedicated (separate) indexing task',
'Move vectors indexing to dedicated (separate) indexing task'),
('2021-06-24 00:03:16',
'LUCENE-9613: Create blocks for ords when it helps Lucene80DocValuesFormat',
'LUCENE-9613: Create blocks for ords when it helps Lucene80DocValuesFormat'),
('2021-08-24 00:03:22',
'LUCENE-5309: specialize single-valued SortedSetDocValues faceting',
'LUCENE-5309: specialize single-valued SortedSetDocValues faceting'),
('2021-08-26 07:26:00',
'LUCENE-10067: specialize SSDV ordinal decode',
'LUCENE-10067: specialize SSDV ordinal decode'),
('2021-08-27 10:46:59',
'Upgrade to JDK 16.0.2+7',
'Upgrade to JDK 16.0.2+7'),
('2021-09-01 00:03:16',
'LUCENE-9662: CheckIndex should be concurrent',
'LUCENE-9662: CheckIndex should be concurrent',),
('2021-09-03 00:03:25',
'Use 16 concurrent threads for CheckIndex',
'Use 16 concurrent threads for CheckIndex'),
('2021-09-25 00:03:25',
'LUCENE-10109: Increase default beam width from 16 to 100',
'LUCENE-10109: Increase default beam width from 16 to 100'),
('2021-10-05 12:21:08',
'Upgrade Linux kernel from 5.13.12 to 5.14.8',
'Upgrade Linux kernel from 5.13.12 to 5.14.8'),
('2021-10-19 08:14:33',
'Upgrade to JDK17+35, and pass -release to ecj linting',
'Upgrade to JDK17+35, and pass -release to ecj linting'),
('2021-11-29 ',
'Stop passing -release to ecj since it makes it quite a bit slower',
'Stop passing -release to ecj since it makes it quite a bit slower'),
('2021-11-24 18:04:23',
'LUCENE-10062: switch to storing taxonomy Facet ordinals from custom encoding in BINARY DV field, to SSDV field',
'LUCENE-10062: switch to storing taxonomy Facet ordinals from custom encoding in BINARY DV field, to SSDV field'),
('2021-12-21',
'Upgrade Arch Linux kernel from 5.14.x to 5.15.10',
'Upgrade Arch Linux kernel from 5.14.x to 5.15.10'),
('2022-01-03 18:03:13',
'LUCENE-10346: specialize single-valued doc values during taxonomy facet counting',
'LUCENE-10346: specialize single-valued doc values during taxonomy facet counting'),
('2022-01-19 10:17:11',
'Upgrade arch linux 5.15.10 -> 5.16.1; LUCENE-10375: Speed up HNSW merge by writing combined vector data',
'Upgrade arch linux 5.15.10 -> 5.16.1; LUCENE-10375: Speed up HNSW merge by writing combined vector data'),
('2022-01-26 18:03:08',
'LUCENE-10054: Make HnswGraph hierarchical',
'LUCENE-10054: Make HnswGraph hierarchical'),
('2022-02-18 07:54:59',
'LUCENE-10391: Reuse data structures across HnswGraph#searchLevel calls',
'LUCENE-10391: Reuse data structures across HnswGraph#searchLevel calls'),
('2022-02-18 07:54:59',
'LUCENE-10408 Better encoding of doc Ids in vectors',
'LUCENE-10408 Better encoding of doc Ids in vectors'),
('2022-02-25 18:03:10',
'LUCENE-10421: Use fixed seed for HNSW search',
'LUCENE-10421: Use fixed seed for HNSW search'),
('2022-03-23 18:03:07',
'LUCENE-10481: FacetsCollector sets ScoreMode.COMPLETE_NO_SCORES when scores are not needed',
'LUCENE-10481: FacetsCollector sets ScoreMode.COMPLETE_NO_SCORES when scores are not needed'),
('2022-04-21 18:03:04',
'LUCENE-10517: specialize SSDV pure-browse facets for some cases',
'LUCENE-10517: specialize SSDV pure-browse facets for some cases'),
('2022-05-12 18:02:51',
'LUCENE-10527: Use 2*maxConn for last layer in HNSW',
'LUCENE-10527: Use 2*maxConn for last layer in HNSW'),
('2022-06-07 18:02:50',
'LUCENE-10078: Enable merge-on-refresh by default',
'LUCENE-10078: Enable merge-on-refresh by default'),
('2022-07-04 18:02:46',
'LUCENE-10480: Use BMM scorer for 2 clauses disjunction',
'LUCENE-10480: Use BMM scorer for 2 clauses disjunction'),
('2022-07-08 18:02:52',
'LUCENE-10480: Move scoring from advance to TwoPhaseIterator#matches',
'LUCENE-10480: Move scoring from advance to TwoPhaseIterator#matches'),
('2022-07-13 18:02:33',
'#1010: Specialize ordinal encoding for SortedSetDocValues',
'#1010: Specialize ordinal encoding for SortedSetDocValues'),
('2022-07-23 06:00:31',
'LUCENE-10592: Build HNSW graph during indexing',
'LUCENE-10592: Build HNSW graph during indexing'),
('2022-07-30 18:02:50',
'LUCENE-10633: Dynamic pruning for queries sorted by SORTED(_SET) field',
'LUCENE-10633: Dynamic pruning for queries sorted by SORTED(_SET) field'),
]
# TODO
# - need a tiny docs test? catch per-doc overhead regressions...
# - click on graph should go to details page
# - nrt
# - chart all reopen times by time...?
# - chart over-time mean/stddev reopen time
# - maybe multiple queries on one graph...?
DEBUG = '-debug' in sys.argv
JFR_STACK_SIZES = (1, 2, 4, 8, 12)
if DEBUG:
NIGHTLY_DIR = 'trunk'
else:
NIGHTLY_DIR = 'trunk.nightly'
DIR_IMPL = 'MMapDirectory'
INDEXING_RAM_BUFFER_MB = 2048
COUNTS_PER_CAT = 5
TASK_REPEAT_COUNT = 50
#MED_WIKI_BYTES_PER_DOC = 950.21921304868431
#BIG_WIKI_BYTES_PER_DOC = 4183.3843150398807
NRT_DOCS_PER_SECOND = 1103 # = 1 MB / avg med wiki doc size
NRT_RUN_TIME = 30*60
NRT_SEARCH_THREADS = 4
NRT_INDEX_THREADS = 1
NRT_REOPENS_PER_SEC = 1
JVM_COUNT = 20
if DEBUG:
NRT_RUN_TIME //= 90
JVM_COUNT = 3
reBytesIndexed = re.compile('^Indexer: net bytes indexed (.*)$', re.MULTILINE)
reIndexingTime = re.compile(r'^Indexer: finished \((.*) msec\)', re.MULTILINE)
reSVNRev = re.compile(r'revision (.*?)\.')
reIndexAtClose = re.compile('Indexer: at close: (.*?)$', re.M)
reGitHubPROpen = re.compile(r'\s(\d+) Open')
reGitHubPRClosed = re.compile(r'\s(\d+) Closed')
REAL = True
def now():
return datetime.datetime.now()
def toSeconds(td):
return td.days * 86400 + td.seconds + td.microseconds/1000000.
def message(s):
print('[%s] %s' % (now(), s))
def runCommand(command):
if REAL:
message('RUN: %s' % command)
t0 = time.time()
if os.system(command):
message(' FAILED')
raise RuntimeError('command failed: %s' % command)
message(' took %.1f sec' % (time.time()-t0))
else:
message('WOULD RUN: %s' % command)
def buildIndex(r, runLogDir, desc, index, logFile):
message('build %s' % desc)
#t0 = now()
indexPath = benchUtil.nameToIndexPath(index.getName())
if os.path.exists(indexPath):
shutil.rmtree(indexPath)
if REAL:
# aggregate at multiple stack depths so we can see patterns like "new BytesRef() is costly regardless of context", for example:
indexPath, fullLogFile, profilerResults, jfrFile = r.makeIndex('nightly', index, profilerCount=50, profilerStackSize=JFR_STACK_SIZES)
else:
profilerResults = None
jfrFile = None
#indexTime = (now()-t0)
if REAL:
print(('Move log to %s/%s' % (runLogDir, logFile)))
os.rename(fullLogFile, '%s/%s' % (runLogDir, logFile))
s = open('%s/%s' % (runLogDir, logFile)).read()
bytesIndexed = int(reBytesIndexed.search(s).group(1))
m = reIndexAtClose.search(s)
if m is not None:
indexAtClose = m.group(1)
else:
# we have no index when we don't -waitForCommit
indexAtClose = None
indexTimeSec = int(reIndexingTime.search(s).group(1))/1000.0
message(' took %.1f sec' % indexTimeSec)
if '(fast)' in desc:
# don't run checkIndex: we rollback in the end
pass
else:
# checkIndex
checkLogFileName = '%s/checkIndex.%s' % (runLogDir, logFile)
checkIndex(r, indexPath, checkLogFileName)
return indexPath, indexTimeSec, bytesIndexed, indexAtClose, profilerResults, jfrFile
def checkIndex(r, indexPath, checkLogFileName):
message('run CheckIndex')
cmd = '%s -classpath "%s" -ea org.apache.lucene.index.CheckIndex -threadCount 16 "%s" > %s 2>&1' % \
(constants.JAVA_COMMAND,
benchUtil.classPathToString(benchUtil.getClassPath(NIGHTLY_DIR)),
indexPath + '/index',
checkLogFileName)
runCommand(cmd)
if open(checkLogFileName, 'r', encoding='utf-8').read().find('No problems were detected with this index') == -1:
raise RuntimeError('CheckIndex failed')
reNRTReopenTime = re.compile('^Reopen: +([0-9.]+) msec$', re.MULTILINE)
def runNRTTest(r, indexPath, runLogDir):
open('body10.tasks', 'w').write('Term: body:10\n')
cmd = '%s -classpath "%s" perf.NRTPerfTest %s "%s" multi "%s" 17 %s %s %s %s %s update 5 no 0.0 body10.tasks' % \
(constants.JAVA_COMMAND,
benchUtil.classPathToString(benchUtil.getClassPath(NIGHTLY_DIR)),
DIR_IMPL,
indexPath + '/index',
constants.NIGHTLY_MEDIUM_LINE_FILE,
NRT_DOCS_PER_SECOND,
NRT_RUN_TIME,
NRT_SEARCH_THREADS,
NRT_INDEX_THREADS,
NRT_REOPENS_PER_SEC)
logFile = '%s/nrt.log' % runLogDir
cmd += '> %s 2>&1' % logFile
runCommand(cmd)
times = []
for s in reNRTReopenTime.findall(open(logFile, 'r', encoding='utf-8').read()):
times.append(float(s))
# Discard first 10 (JVM warmup)
times = times[10:]
# Discard worst 2%
times.sort()
numDrop = len(times)//50
if numDrop > 0:
message('drop: %s' % ' '.join(['%.1f' % x for x in times[-numDrop:]]))
times = times[:-numDrop]
message('times: %s' % ' '.join(['%.1f' % x for x in times]))
min, max, mean, stdDev = stats.getStats(times)
message('NRT reopen time (msec) mean=%.4f stdDev=%.4f' % (mean, stdDev))
checkIndex(r, indexPath, '%s/checkIndex.nrt.log' % runLogDir)
return mean, stdDev
def run():
openPRCount, closedPRCount = countGitHubPullRequests()
MEDIUM_INDEX_NUM_DOCS = constants.NIGHTLY_MEDIUM_INDEX_NUM_DOCS
BIG_INDEX_NUM_DOCS = constants.NIGHTLY_BIG_INDEX_NUM_DOCS
if DEBUG:
# Must re-direct all logs so we don't overwrite the "production" run's logs:
constants.LOGS_DIR = '/l/trunk/lucene/benchmark'
MEDIUM_INDEX_NUM_DOCS //= 100
BIG_INDEX_NUM_DOCS //= 100
DO_RESET = '-reset' in sys.argv
if DO_RESET:
print('will reset results files!')
else:
print('will compare to last goot result files!')
# TODO: understand why the attempted removal in Competition.benchmark did not actually run for nightly bench!
for fileName in glob.glob(f'{constants.LOGS_DIR}/bench-search-*.jfr'):
print('Removing old JFR %s...' % fileName)
os.remove(fileName)
print()
print()
print()
print()
message('start')
id = 'nightly'
if not REAL:
start = datetime.datetime(year=2011, month=5, day=19, hour=23, minute=00, second=0o1)
else:
start = now()
timeStamp = '%04d.%02d.%02d.%02d.%02d.%02d' % (start.year, start.month, start.day, start.hour, start.minute, start.second)
runLogDir = '%s/%s' % (constants.NIGHTLY_LOG_DIR, timeStamp)
if REAL:
os.makedirs(runLogDir)
message('log dir %s' % runLogDir)
if not REAL:
os.chdir('%s/%s' % (constants.BASE_DIR, NIGHTLY_DIR))
svnRev = '1102160'
luceneUtilRev = '2270c7a8b3ac+ tip'
print('SVN rev is %s' % svnRev)
print('luceneutil rev is %s' % luceneUtilRev)
else:
os.chdir(constants.BENCH_BASE_DIR)
luceneUtilRev = os.popen('git rev-parse HEAD').read().strip()
os.chdir('%s/%s' % (constants.BASE_DIR, NIGHTLY_DIR))
#runCommand('%s cleanup' % constants.SVN_EXE)
runCommand('%s clean -xfd' % constants.GIT_EXE)
luceneRev = os.popen('git rev-parse HEAD').read().strip()
if True:
iters = 30
for i in range(iters):
try:
#runCommand('%s update > %s/update.log' % (constants.SVN_EXE, runLogDir))
runCommand('%s checkout main; %s pull origin main > %s/update.log' % (constants.GIT_EXE, constants.GIT_EXE, runLogDir))
except RuntimeError:
message(' retry...')
time.sleep(60.0)
else:
luceneRev = os.popen('git rev-parse HEAD').read().strip()
#svnRev = int(reSVNRev.search(open('%s/update.log' % runLogDir, 'rb').read()).group(1))
print('LUCENE rev is %s' % luceneRev)
break
else:
raise RuntimeError('failed to run git pull after %d tries' % iters)
print('luceneutil rev is %s' % luceneUtilRev)
javaVersion = os.popen('%s -fullversion 2>&1' % constants.JAVA_COMMAND).read().strip()
print('%s' % javaVersion)
print('uname -a: %s' % os.popen('uname -a 2>&1').read().strip())
print('lsb_release -a:\n%s' % os.popen('lsb_release -a 2>&1').read().strip())
print('Java command-line: %s' % constants.JAVA_COMMAND)
try:
s = open('/sys/kernel/mm/transparent_hugepage/enabled').read()
except:
print('Unable to read /sys/kernel/mm/transparent_hugepage/enabled')
else:
print(('transparent_hugepages: %s' % s))
runCommand('%s clean > %s/clean-lucene.log 2>&1' % (constants.GRADLE_EXE, runLogDir))
runCommand('%s jar > %s/jar-lucene.log 2>&1' % (constants.GRADLE_EXE, runLogDir))
r = benchUtil.RunAlgs(constants.JAVA_COMMAND, True, True)
comp = competition.Competition(taskRepeatCount=TASK_REPEAT_COUNT,
taskCountPerCat=COUNTS_PER_CAT,
verifyCounts=False) # only verify top hits, not counts
mediumSource = competition.Data('wikimedium',
constants.NIGHTLY_MEDIUM_LINE_FILE,
MEDIUM_INDEX_NUM_DOCS,
constants.WIKI_MEDIUM_TASKS_FILE)
fastIndexMedium = comp.newIndex(NIGHTLY_DIR, mediumSource,
analyzer='StandardAnalyzerNoStopWords',
postingsFormat='Lucene90',
numThreads=constants.INDEX_NUM_THREADS,
directory=DIR_IMPL,
idFieldPostingsFormat='Lucene90',
ramBufferMB=INDEXING_RAM_BUFFER_MB,
waitForMerges=False,
waitForCommit=False,
disableIOThrottle=True,
grouping=False,
verbose=False,
mergePolicy='TieredMergePolicy',
maxConcurrentMerges=12,
useCMS=True)
fastIndexMediumVectors = comp.newIndex(NIGHTLY_DIR, mediumSource,
analyzer='StandardAnalyzerNoStopWords',
postingsFormat='Lucene90',
numThreads=constants.INDEX_NUM_THREADS,
directory=DIR_IMPL,
idFieldPostingsFormat='Lucene90',
ramBufferMB=INDEXING_RAM_BUFFER_MB,
waitForMerges=False,
waitForCommit=False,
disableIOThrottle=True,
grouping=False,
verbose=False,
mergePolicy='TieredMergePolicy',
maxConcurrentMerges=12,
useCMS=True,
vectorFile=constants.GLOVE_VECTOR_DOCS_FILE,
vectorDimension=100,
vectorEncoding='FLOAT32')
nrtIndexMedium = comp.newIndex(NIGHTLY_DIR, mediumSource,
analyzer='StandardAnalyzerNoStopWords',
postingsFormat='Lucene90',
numThreads=constants.INDEX_NUM_THREADS,
directory=DIR_IMPL,
idFieldPostingsFormat='Lucene90',
ramBufferMB=INDEXING_RAM_BUFFER_MB,
waitForMerges=True,
waitForCommit=True,
disableIOThrottle=True,
grouping=False,
verbose=False,
mergePolicy='TieredMergePolicy',
maxConcurrentMerges=12,
useCMS=True,
addDVFields=True)