Comments (5)
PLY was originally written on a 200 Mhz PC and the initial implementation was quite slow at table generation (a large grammar could take tens of seconds). Machines have become much faster and PLY uses a significantly better algorithm than it did before. On my current desktop machine, generating tables for the full ANSI C grammar barely takes 0.1 second.
Writing of cache files was always problematic for various reasons--especially for deployment and packaging. Most people do not expect a third-party package to be implicitly writing temporary files as a side-effect of usage. Frankly, it was a never-ending source of bug reports and I'm glad to be rid of it.
If you want the parsing tables to be cached, the parser should be serializable with pickle. Use that to write it out and bring it back in your application. Alternatively, if startup time matters a lot, you might consider writing a daemonized parser instead.
from ply.
The feature of writing tables was removed entirely at some point. However, I think this was post-3.11 and would only be present in code copied from GitHub.
from ply.
Thanks!
from ply.
The feature of writing tables was removed entirely at some point. However, I think this was post-3.11 and would only be present in code copied from GitHub.
Excuse me for opening the issue again, I've noticed Massive refactoring/cleanup commit removes optimized mode and all related stuff, including cached tables. Can you elaborate in a few words the rationale, please? Is there any potential performance degradation related to it? I've seen these tables in pycparser (it still uses ply 3.10), for example
from ply.
If you want the parsing tables to be cached, the parser should be serializable with pickle. Use that to write it out and bring it back in your application. Alternatively, if startup time matters a lot, you might consider writing a daemonized parser instead.
Thank you for your time, sir. Totally makes sense.
from ply.
Related Issues (20)
- Are there any recommendations for grammar rules references to parse C language?
- Exporting grammar for documentation
- Invalid Syntax when importing module in yacc
- Configuring ID
- Space as a part of lexeme HOT 2
- Allow cloning a parser HOT 1
- How can I assign p arguments when there are two non-terminals side by side (PLY) HOT 7
- Whether tok.type can be acquired at parser
- Parse HQL with STRUCT Comment returns empty
- Simple typo in doc/ply.md about error handler example HOT 1
- Python 3.11: inability to use global inline flags HOT 3
- Warn user about tuple flattening in precedence table HOT 3
- PyPI package HOT 2
- Trying to get in touch regarding a security issue
- "global flags not at the start of the expression" error when using in-line global regex flag with Python 11+ HOT 1
- t_AUTOINCREMENT error ?
- Please make a new release HOT 1
- PLY not compatible with python 3.12 HOT 1
- extreme slowness HOT 5
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 ply.