|
Re: Efficiency of Network Tables
FWIW, in the past NetworkTables has had locking issues. However, it was completely rewritten this year by someone I trust to write it correctly, but it's possible that there are some issues somewhere that haven't been caught yet.
Even without bad locking issues causing delays, I'd be willing to bet that each read of a NetworkTables variable is going through a lock (I haven't looked at this year's code) or two, so it will add up a little bit... though, probably not 75ms worth (take it out, see what happens?).
The way I get around this latency in pynetworktables is we provide "auto update values" and ntproperty, which just create a placeholder object that you can read from atomically without taking a lock. The object gets updated by a subscriber which will update the value anytime an update is received from the network -- so it's only changing when the value actually changes.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/ pynetworktables2js (NetworkTables for Python & Javascript)
2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award
Resources: FIRSTWiki (relaunched!) | My Software Stuff
|