Performance / tracing #428
mikeaustin
started this conversation in
General
Replies: 1 comment 1 reply
-
You are correct that the version with How complicated is PrimaryExpression? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First, I want to say I'm glad peggy is still chugging a long and there is new activity and new versions. I love it and the former pegjs for it's simplicity and for it's tight JS integration which requires much less boilerplate.
I've re-written my language (Kopi) many times in Peg**, and sometimes I hit a performance issue. In my current version, there is a 16 × difference in speed in parsing with * or ? vs using a "/". I can get around it, but the rules are not as clean.
I believe what is happening is that using the "*" and "?", the PrimaryExpression can be re-used, while using "/" the expression is discarded and the alternate expression needs to be parsed again. Is that a correct assumption?
vs
Should I just always use the "*" and "?" style for precedence rules?
Beta Was this translation helpful? Give feedback.
All reactions