Code Monkey home page Code Monkey logo

Comments (5)

dabeaz avatar dabeaz commented on July 29, 2024 1

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.

dabeaz avatar dabeaz commented on July 29, 2024

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.

paudano avatar paudano commented on July 29, 2024

Thanks!

from ply.

nxmaintainer avatar nxmaintainer commented on July 29, 2024

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.

nxmaintainer avatar nxmaintainer commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.