|
| 1 | +analysis = ''' |
| 2 | +These benchmarks were ported out of the jetscii crate, specifically from |
| 3 | +[Dr-Emann's PR]. There were some irregularities in the benchmark results, so |
| 4 | +I thought it might be interesting to include it here. |
| 5 | +
|
| 6 | +We add "real" variants of each benchmark as well using a small XML data set on |
| 7 | +mental health. The original benchmarks search a haystack consisting entirely of |
| 8 | +`a` repeated, with the last byte corresponding to one of the needle bytes. This |
| 9 | +is useful for measuring pure throughput, but less good for approximating real |
| 10 | +world performance. In this case, for at least `xml-delim3` and `xml-delim5`, it |
| 11 | +seems like an XML haystack would be better suited. |
| 12 | +
|
| 13 | +[Dr-Emann's PR]: https://github.com/shepmaster/jetscii/pull/57 |
| 14 | +''' |
| 15 | + |
| 16 | +[[bench]] |
| 17 | +model = "count" |
| 18 | +name = "space-repeateda" |
| 19 | +regex = [' '] |
| 20 | +haystack = { contents = "a", repeat = 5_242_880, append = " " } |
| 21 | +count = 1 |
| 22 | +engines = [ |
| 23 | + "daachorse/bytewise/leftmost-first", |
| 24 | + "rust/aho-corasick/dfa/leftmost-first", |
| 25 | + "rust/aho-corasick/packed/leftmost-first", |
| 26 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 27 | + "rust/jetscii/ascii-chars/prebuilt", |
| 28 | +] |
| 29 | + |
| 30 | +[[bench]] |
| 31 | +model = "count" |
| 32 | +name = "xmldelim3-repeateda" |
| 33 | +regex = ['<', '>', '&'] |
| 34 | +haystack = { contents = "a", repeat = 5_242_880, append = "&" } |
| 35 | +count = 1 |
| 36 | +engines = [ |
| 37 | + "daachorse/bytewise/leftmost-first", |
| 38 | + "rust/aho-corasick/dfa/leftmost-first", |
| 39 | + "rust/aho-corasick/packed/leftmost-first", |
| 40 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 41 | + "rust/jetscii/ascii-chars/prebuilt", |
| 42 | +] |
| 43 | + |
| 44 | +[[bench]] |
| 45 | +model = "count" |
| 46 | +name = "xmldelim5-repeateda" |
| 47 | +regex = ['<', '>', '&', "'", '"'] |
| 48 | +haystack = { contents = "a", repeat = 5_242_880, append = '"' } |
| 49 | +count = 1 |
| 50 | +engines = [ |
| 51 | + "daachorse/bytewise/leftmost-first", |
| 52 | + "rust/aho-corasick/dfa/leftmost-first", |
| 53 | + "rust/aho-corasick/packed/leftmost-first", |
| 54 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 55 | + "rust/jetscii/ascii-chars/prebuilt", |
| 56 | +] |
| 57 | + |
| 58 | +[[bench]] |
| 59 | +model = "count" |
| 60 | +name = "big16-repeateda" |
| 61 | +regex = [ |
| 62 | + 'A', 'B', 'C', 'D', |
| 63 | + 'E', 'F', 'G', 'H', |
| 64 | + 'I', 'J', 'K', 'L', |
| 65 | + 'M', 'N', 'O', 'P', |
| 66 | +] |
| 67 | +haystack = { contents = "a", repeat = 5_242_880, append = "P" } |
| 68 | +count = 1 |
| 69 | +engines = [ |
| 70 | + "daachorse/bytewise/leftmost-first", |
| 71 | + "rust/aho-corasick/dfa/leftmost-first", |
| 72 | + "rust/aho-corasick/packed/leftmost-first", |
| 73 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 74 | + "rust/jetscii/ascii-chars/prebuilt", |
| 75 | +] |
| 76 | + |
| 77 | +[[bench]] |
| 78 | +model = "count" |
| 79 | +name = "big16earlyshort-repeateda" |
| 80 | +regex = [ |
| 81 | + 'A', 'B', 'C', 'D', |
| 82 | + 'E', 'F', 'G', 'H', |
| 83 | + 'I', 'J', 'K', 'L', |
| 84 | + 'M', 'N', 'O', 'P', |
| 85 | +] |
| 86 | +haystack = { contents = "Pa" } |
| 87 | +count = 1 |
| 88 | +engines = [ |
| 89 | + "daachorse/bytewise/leftmost-first", |
| 90 | + "rust/aho-corasick/dfa/leftmost-first", |
| 91 | + "rust/aho-corasick/packed/leftmost-first", |
| 92 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 93 | + "rust/jetscii/ascii-chars/prebuilt", |
| 94 | +] |
| 95 | + |
| 96 | +[[bench]] |
| 97 | +model = "count" |
| 98 | +name = "big16earlylong-repeateda" |
| 99 | +regex = [ |
| 100 | + 'A', 'B', 'C', 'D', |
| 101 | + 'E', 'F', 'G', 'H', |
| 102 | + 'I', 'J', 'K', 'L', |
| 103 | + 'M', 'N', 'O', 'P', |
| 104 | +] |
| 105 | +haystack = { contents = "a", repeat = 14, append = "P" } |
| 106 | +count = 1 |
| 107 | +engines = [ |
| 108 | + "daachorse/bytewise/leftmost-first", |
| 109 | + "rust/aho-corasick/dfa/leftmost-first", |
| 110 | + "rust/aho-corasick/packed/leftmost-first", |
| 111 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 112 | + "rust/jetscii/ascii-chars/prebuilt", |
| 113 | +] |
| 114 | + |
| 115 | +[[bench]] |
| 116 | +model = "count" |
| 117 | +name = "space-mentalhealth" |
| 118 | +regex = [' '] |
| 119 | +haystack = { path = "catalog.data.gov/mental-health-4weeks.xml" } |
| 120 | +count = 1_181_201 |
| 121 | +engines = [ |
| 122 | + "daachorse/bytewise/leftmost-first", |
| 123 | + "rust/aho-corasick/dfa/leftmost-first", |
| 124 | + "rust/aho-corasick/packed/leftmost-first", |
| 125 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 126 | + "rust/jetscii/ascii-chars/prebuilt", |
| 127 | +] |
| 128 | + |
| 129 | +[[bench]] |
| 130 | +model = "count" |
| 131 | +name = "xmldelim3-mentalhealth" |
| 132 | +regex = ['<', '>', '&'] |
| 133 | +haystack = { path = "catalog.data.gov/mental-health-4weeks.xml" } |
| 134 | +count = 604_714 |
| 135 | +engines = [ |
| 136 | + "daachorse/bytewise/leftmost-first", |
| 137 | + "rust/aho-corasick/dfa/leftmost-first", |
| 138 | + "rust/aho-corasick/packed/leftmost-first", |
| 139 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 140 | + "rust/jetscii/ascii-chars/prebuilt", |
| 141 | +] |
| 142 | + |
| 143 | +[[bench]] |
| 144 | +model = "count" |
| 145 | +name = "xmldelim5-mentalhealth" |
| 146 | +regex = ['<', '>', '&', "'", '"'] |
| 147 | +haystack = { path = "catalog.data.gov/mental-health-4weeks.xml" } |
| 148 | +count = 688_252 |
| 149 | +engines = [ |
| 150 | + "daachorse/bytewise/leftmost-first", |
| 151 | + "rust/aho-corasick/dfa/leftmost-first", |
| 152 | + "rust/aho-corasick/packed/leftmost-first", |
| 153 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 154 | + "rust/jetscii/ascii-chars/prebuilt", |
| 155 | +] |
| 156 | + |
| 157 | +[[bench]] |
| 158 | +model = "count" |
| 159 | +name = "big16-mentalhealth" |
| 160 | +regex = [ |
| 161 | + 'A', 'B', 'C', 'D', |
| 162 | + 'E', 'F', 'G', 'H', |
| 163 | + 'I', 'J', 'K', 'L', |
| 164 | + 'M', 'N', 'O', 'P', |
| 165 | +] |
| 166 | +haystack = { path = "catalog.data.gov/mental-health-4weeks.xml" } |
| 167 | +count = 176_447 |
| 168 | +engines = [ |
| 169 | + "daachorse/bytewise/leftmost-first", |
| 170 | + "rust/aho-corasick/dfa/leftmost-first", |
| 171 | + "rust/aho-corasick/packed/leftmost-first", |
| 172 | + "rust/old-aho-corasick/packed/leftmost-first", |
| 173 | + "rust/jetscii/ascii-chars/prebuilt", |
| 174 | +] |
0 commit comments