Commit fa27574
committed
Default to re2 parser is available
After benchmarking, the results are out, at least on the current
sample file:
First, re2 is ridiculously faster than the basic parser, even with
tons of caching. re2 does benefit from caching, but it's so fast that
it needs very high hitrates (so a very large cache) for the caching to
have a real impact, it's fast enough that at low hitrates (small
sizes) the cache does slow down parsing visibly which is not the case
of the basic parser.
Second, LRU is confirmed to be a better cache replacement policy than
clearing (which... duh), it's not super sensible at very low sizes but
at 100 entries it starts really pulling ahead, so definitely the
better default at 200 (where even with the overhead of the more
layered approach it's ahead of the legacy parser and its immutable 20
entries clearing cache).
The locking doesn't seem to have much impact without contention, and
even contended the LRU seems to behave way better than the clearing
cache still. So fallback onto locked LRU if re2 is not available.1 parent 9960dbd commit fa27574
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
68 | 74 | | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| |||
0 commit comments