-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Peg only mode? #46
Comments
Thanks for sharing the performance results. Unfortunately, packrat parsing is essential for PackCC, because one of the most beneficial features of PackCC is left-recursive grammar rule support, which cannot be realized without packrat parsing. Moreover, I'm not motivated to make PackCC implementation more complicated by dual algorithms. |
@arithy No problem. I think some things in packcc could be improved by some benchmarking regardless, for example: If i repeatedly called the parser like in the calculator example, 90 percent of the cpu time was spent in memmove shifting the packcc arrays, I wondered if there might be a simple solution for such cases and if my result was actually just something easily fixed. |
Thanks for the valuable information. P.S. Your requests and suggestions will be welcome from now on, too. |
Just to make sure: Are you talking about the performance of grammar parsing or of the generated code parsing the assembler? If it is about the generated code, then I have done some analysis in the past. It turns out a lot of time is wasted in memory allocations for each rule. Some details can be found in universal-ctags/ctags#2878. There are two possible approaches: either reduce number of rules (could be done automatically when generating the code) or use better allocator. Actually both could be useful at the same time. I have started working on this with promising results, but ever finished. I can push the code, if anyone is interested in the work in progress. |
I will make an issue with an example. |
@dolik-rce, thanks for informing me of your activity on performance improvement. |
I created #47 which shows how the parser performance differs greatly when using in two slightly different ways. |
@andrewchambers, thanks a lot! |
@arithy I think even the fast case in my example is slower than expected - 1 second for 100k lines seems fairly slow - I think leg was 100x this speed and so was gnu as. |
I was benchmarking leg vs packcc for https://github.com/andrewchambers/minias and saw that leg is both 10x faster and uses 10x less ram for my examples - I think in many cases the overhead of packrat parsing might not be worth it.
I was wondering if there is any chance for a peg only mode or peg only port, as packcc has many other advantages over peg/leg.
The text was updated successfully, but these errors were encountered: