Commit 34432af
committed
Make regex-filtered re2 bench easier to run
Also make both re2 and regex benches run using simplified /
down-compiled regexes.
At this point, regex-filtered trounces FilteredRE2 on CPU *for the
specific job of ua-parsing*, and its memory use has gotten quite
reasonable (overhead compared to re2 is down to just 20%):
```sh
> /usr/bin/time -l target/bench_re2 \
target/devices.regexes regex-filtered/samples/useragents.txt 100 -q
633 regexes 1630 atoms in 0.0200757s
prefilter built in 0.00527812s
75158 user agents in 0.0353107s
49.67 real 48.88 user 0.35 sys
43958272 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
3499 page reclaims
289 page faults
0 swaps
0 block input operations
0 block output operations
0 messages sent
0 messages received
0 signals received
2 voluntary context switches
28247 involuntary context switches
600560455436 instructions retired
157226396942 cycles elapsed
35309696 peak memory footprint
> /usr/bin/time -l target/release/examples/bench_regex \
target/devices.regexes regex-filtered/samples/useragents.txt -r 100 -q
633 regexes in 0.051890332s
75158 user agents in 0.007460291s
38.93 real 38.52 user 0.22 sys
43958272 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
2798 page reclaims
98 page faults
0 swaps
0 block input operations
0 block output operations
0 messages sent
0 messages received
0 signals received
0 voluntary context switches
17680 involuntary context switches
372376225085 instructions retired
123339367792 cycles elapsed
42370560 peak memory footprint
```
note: bench.rs was renamed to stop conflicting with the one in
ua-parser, and make the two bench programs easier to differentiate.
Also one day I need to look into the difference between maximum rss
and peak memory footprint on macos. It seems weird that RSS matches
between the two programs, and RSS and peak match for rust, but re2's
peak is 25% lower.1 parent 18fab27 commit 34432af
File tree
6 files changed
+147
-12
lines changed- regex-filtered
- examples
- re2
- scripts
6 files changed
+147
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
| 6 | + | |
7 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
File renamed without changes.
File renamed without changes.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments