You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Parser0 has a private[parse] def parseMut(state: Parser.State): A method. To implement .void we keep track of a mutable var in State and set capturing = false so we can avoid allocation.
In this picture, a case class Void(inner: Parser[Any) extends Parser[Unit] would just call parseMutVoid for its parseMut and parseMutVoid. This would potentially do less work since once we convert over to the parseMutVoid we don't check capture again all the way down.
We may or may not have a broad enough set of benchmarks to see a win here, but it may be worth a try.
The text was updated successfully, but these errors were encountered:
Currently
Parser0
has aprivate[parse] def parseMut(state: Parser.State): A
method. To implement.void
we keep track of a mutable var inState
and setcapturing = false
so we can avoid allocation.An alternate design would be:
In this picture, a
case class Void(inner: Parser[Any) extends Parser[Unit]
would just callparseMutVoid
for its parseMut and parseMutVoid. This would potentially do less work since once we convert over to theparseMutVoid
we don't checkcapture
again all the way down.We may or may not have a broad enough set of benchmarks to see a win here, but it may be worth a try.
The text was updated successfully, but these errors were encountered: