Giter Site home page Giter Site logo

Comments (5)

cs01 avatar cs01 commented on May 5, 2024 1

I think there could absolutely be a speed up in the non-io bound stuff. Rust is way faster than Python. IIRC the unit tests ensure the parsing is done in o(n) time. If they don’t currently they definitely used to.

There was a pull request a while back where large strings were parsed more quickly by taking advantage of some implementation details of Python.

Anyway, thanks for sharing and good luck on your finals.

from pygdbmi.

cs01 avatar cs01 commented on May 5, 2024

Thanks for sharing, that’s awesome! I considered doing this to learn rust but never found the time.

There should be a way to call rust from Python. I would love to call into your parser from pygdbmi, since parsing with Python can be a bottleneck.

from pygdbmi.

dzfranklin avatar dzfranklin commented on May 5, 2024

I can look into that. I'm currently technically supposed to be doing finals, so I can't promise promptness :)

My current architecture has a worker that reads from stderr/stdout and also from a channel of messages to send to gdb over stdin. Then there's a frontend that takes commands from the user and sends them to the worker over the channel, and receives the matching replies back when worker gets them. So the actual io is single threaded, but you can send a command while waiting for the result of another (unless it's a console command).

In theory I think that makes sense, but I haven't tried it on any real world data yet. I'm definitely interested if you have any good ideas for benchmarks/what's been a performance issue for you.

I think it's be pretty easy to write python bindings for the parser bit, since it's a synchronous function that takes a string a returns a simple-ish type. In theory it seems possible to call async rust code from python, so we could also build that.

I noticed in another issue you were considering rewriting the backend server. It might be easier for me to write a Rust server frontend than to have python sit in front of it. On the other hand you might prefer more of the code to be in a language you're comfortable with.

What do you think?

from pygdbmi.

cs01 avatar cs01 commented on May 5, 2024

If I’m being honest with myself, I don’t really have the time to devote to these projects (pygdbmi and gdbgui) other than maintenance. And I’d be hesitant to adopt any major rewrite since the projects are pretty complex and are stable. I am excited at the idea of an ffi into Rust, but it’s probably best to just leave it alone. Even if it were working, does installation become an issue? I’m not sure if the person installing it will need to be able to compile rust for their platform or if it can be prebuilt.

If there were to be some integration, i would only be interested in the parsing part, not the subprocess management part.

When you say backend server, are you talking about for gdbgui?

from pygdbmi.

dzfranklin avatar dzfranklin commented on May 5, 2024

That all makes sense. I doubt there'd be a huge speedup anyway since it's io bound. Feel free to close this issue.

from pygdbmi.

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.