-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add getLatestMessageOfEveryReceivedArbId() function #37
Add getLatestMessageOfEveryReceivedArbId() function #37
Conversation
Benchmarking resultsHardwareMy pretty-fast laptop connected to 20 SPARK Flexes running alpha firmware ProcedureMeasured how long ResultUnder these conditions, the function took 1-2ms to run. AnalysisI think this was a reasonably tough stress test. The heartbeat only gets sent every 20ms, so 1-2ms is definitely a safe amount of time to block other CAN operations from happening for the relatively infrequent context in which I need to use this method, and it leaves plenty of headroom to account for slower computers and/or even more IDs in the map. Leaving this as a draft until I've tested this with code that actually makes use of the result, and benchmarked that. I'll also make a note to test this on our low-performance testing laptop. |
Just realized that if we also include the actual data, this would become a bulletproof way to display the diagnostic CAN traffic, and we could fully kill the firehose. |
For now, I've just copied the code that assembles a I have not done any performance testing on the new function yet. |
8133f83
to
f98f277
Compare
|
This was necessary to achieve acceptable performance
Going to merge this after approval of the latest changes from Landry, since Dave is away. The functionality works well, with very decent performance (though REVrobotics/CANBridge#42 would make it better). |
@doleksy, the
Napi
types come from this library, used to write native node.js addons in C++: https://github.com/nodejs/node-addon-api/@LandryNorris This uses REVrobotics/CANBridge#41, which is small enough that I was comfortable merging with only Dave's approval, but you should at least look at what it does.
The goal here is to help me reliably determine what devices are on the bus in a manner that is both bulletproof and performant.