GithubHelp home page GithubHelp logo

Comments (12)

PeterJohnson avatar PeterJohnson commented on September 2, 2024

I actually don't think it's that inefficient.. we're writing single bytes but it is buffered by socket.makefile(). I can do some network captures to confirm.

from robotpy-wpilib.

virtuald avatar virtuald commented on September 2, 2024

Maybe.

Another problem that I think I just noticed (I could be wrong) is that you're writing to the network from the robot thread, so the robot will block on network delays. The C++ library had this problem too.

from robotpy-wpilib.

virtuald avatar virtuald commented on September 2, 2024

Actually, there might be a thread in there somewhere.

from robotpy-wpilib.

PeterJohnson avatar PeterJohnson commented on September 2, 2024

It's in a separate thread (WriteManager). I agree the code is very convoluted (the original is a prime example of violating you-aint-gonna-need-it). I've simplified it somewhat from the Java version, but it is still hard to trace how things like updates actually happen.

from robotpy-wpilib.

virtuald avatar virtuald commented on September 2, 2024

Yeah, it is somewhat simpler, but it's still very confusing.

At some point, I'd like to refactor it so it's easier to follow, because there's way too much indirection happening everywhere. I'll change the title of this bug for that.

First though, probably makes sense to get the tests working to validate that the implementation is working, before refactoring.

from robotpy-wpilib.

PeterJohnson avatar PeterJohnson commented on September 2, 2024

I've already started to do some "easy" refactors (merging classes that are only used in one place and the like). Agreed tests are needed, but right now it's almost too convoluted to test efficiently.

from robotpy-wpilib.

PeterJohnson avatar PeterJohnson commented on September 2, 2024

I've also confirmed (with wireshark) we are NOT sending 1-byte payload packets - it's properly buffering and flushing.

from robotpy-wpilib.

virtuald avatar virtuald commented on September 2, 2024

Ok, cool.

from robotpy-wpilib.

virtuald avatar virtuald commented on September 2, 2024

Also, Patrick from WPI had started on a reimplementation of NetworkTables in C++. It could be useful to look at: https://bitbucket.org/byteit101/nwtpp/src

from robotpy-wpilib.

virtuald avatar virtuald commented on September 2, 2024

A good simplification would be to change some (or all) of the listeners to accept callables, instead of requiring overriding a class. Definitely more pythonic.

from robotpy-wpilib.

PeterJohnson avatar PeterJohnson commented on September 2, 2024

We should move this ticket (or rather, close this one and create a new one) to the pynetworktables repo.

from robotpy-wpilib.

virtuald avatar virtuald commented on September 2, 2024

robotpy/pynetworktables#7

from robotpy-wpilib.

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.