Separate lookahead and size benchmarks. #2229
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the two benchmarks used the same
Inner, they would get the same interprocedural optimizations. This doesn't give the full picture about how something changes, so separate them so that we can get a better picture.This definitely makes the benchmarks more "micro," but I believe that we see more people using either lookahead or size, not both on the same unit.
I added a second commit that completely eliminates the need for lookahead in the size benchmark, but I'm not entirely sure that it's fair. I actually think it might be. The problem is that even if lookahead wasn't obviously used, having the literals triggers lookahead. I want it to not use lookahead so that I can have different optimizations for each, but I also understand it's kind of forcing benchmarks to say what I want them to say. My preference would be the lookahead and size benchmarks actually test different things, though, so I don't really mind it - just take the initial results with a grain of salt if we keep it!!
EDIT: And I just looked through Zeek's parsers before/after #2228, there are plenty of hot paths that get their lookaheads removed. I'd like that expressed in some of our benchmarks.