It turns out that the omit_parser::call() shows up pretty high in profiling of Parser. If each parser knew if it was wrapped in a notional omit[], omit[] could just take a parser, and return a copy with true for the template parameter Omit. This means that the actual function call to omit_parser::call() (and omit_parser itself) goes away.
No so sure the other two would be as big a win, but a lot of parsers are something like eps(cond) >> p (that's what if_(cond) expands to). If all those instances, and expect_parser itself, were just built in to every parser (with a nope when there's no prefix and/or sufffix condition(s)), that might similarly speed things up. expect_parser would just go away in that case.
The new parameters would be something like:
It turns out that the
omit_parser::call()
shows up pretty high in profiling of Parser. If each parser knew if it was wrapped in a notionalomit[]
,omit[]
could just take a parser, and return a copy withtrue
for the template parameterOmit
. This means that the actual function call toomit_parser::call()
(andomit_parser
itself) goes away.No so sure the other two would be as big a win, but a lot of parsers are something like
eps(cond) >> p
(that's whatif_(cond)
expands to). If all those instances, andexpect_parser
itself, were just built in to every parser (with anope
when there's no prefix and/or sufffix condition(s)), that might similarly speed things up.expect_parser
would just go away in that case.