Comments (6)
First version of table caching is on the master branch. Please see the updates in the HISTORY.md and the docs. Please test with your code and let me know it you have any trouble.
from parglare.
Parser table serialization is something that I plan to do soon.
What have you tried to do and get slow parsing? Which parser did you use? LR or GLR? parglare is not optimized yet but for my use-cases is fast enough. Maybe you are using GLR and have a lot of non-determinism in the grammar so parglare builds a lot of trees, i.e. investigates a lot of possible interpretations. I can't help any further without more input.
from parglare.
I'm using LR for a grammar more complex than a simple expression language. In fact I have converted a LL(?) grammar (more than 200 lines) for CoCo/R into parglare one because it used some extensions I have not found in publicly available implementations of CoCo/R, such as "zero or more repeats". A try of "compile grammar" -> "gen parser" -> "test on file" pipeline takes nearly a minute with cpython on the hardware available to me at work (I remember that the CPU is some Celeron with SSE2, but without x86_64 ). There are some ambiguites, I know that I would have to use glr somewhen, but it is slow even in LR mode.
from parglare.
How big is the file you are parsing? For LR you should have at least 300Kb/sec more-less depending on the language. GLR has additional overhead and is at the moment approximately 5 times slower.
Can you publicly share your code, grammars, input files? If not can you do some measurements like time needed for the parser to initialize, parsing speed in Kb/sec.
I haven't yet optimized parglare extensively but I'm keeping an eye on performance so I would like to take a look.
from parglare.
importing a grammar takes 1.3 sec, generating a parser takes 154 sec .
from parglare.
from parglare.
Related Issues (20)
- A terminal that doesn't match specific strings HOT 2
- QUESTION: confusing 0.12.0 versions ... HOT 1
- ENHANCEMENT: new parameter for call_actions for not reversing HOT 1
- Parser object singleton or caching. Actions as object members HOT 3
- Error for named matches in an imported grammar with default action HOT 2
- Possible memory leak HOT 4
- Question on AST generation and actions with side effects HOT 1
- 0.13.0 is released
- Support for parenthesized groups HOT 1
- 0.14.0 is released
- 0.15.0 is released
- possible regression in regexp handling HOT 2
- Request to optimize recognizers matching HOT 4
- 0.16.0 is released
- `a_opt: a?;` is not equivalent to `a_opt: a | EMPTY;` and causes an error `First set empty for grammar symbol "a_opt". An infinite recursion on the grammar symbol.` when `a` is a sequence. HOT 4
- advice requested on implementing a language "feature" HOT 1
- Lexical disambiguation not working as expected HOT 1
- Iterating through Forest fails in NodeNonTerm solutions property HOT 3
- Overriding terminal indirectly through multiple module imports fails when using separator repetition HOT 3
- Separate imports of the same file result in multiple "instances" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parglare.