Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
So I am testing to see how fast asio would be just sending and receiving messages of no complexity. I built the UDP server in c++. Then I test the send/receive throughput using Python. Ignoring the slowness of Python I get a send/receive in about 0.05 microseconds. I tested 1000 in a row which took 0.05 milliseconds. Maybe I am simple, but I am always in awe about how fast computers have gotten. I suspect if I wrote the client in C++ those numbers would drop at least a bit due to Python not being super fast. My goal is to run the communication for my plugin at 1 mS or less. I think this is a more than reasonable goal now seeing these numbers.
edit: Now I need to do this test with C#.
BTW, I will be sending json objects back and forth. I don't want a complex data stream for this. The time spent will probably be in decoding and encoding json data. -
galena71755dThe delay sure is amazing. I still have some questions: Is that over localhost or over network? How much jitter is there?
I know Ethernet Powerlink required quiet the many fuckery with FPGA's to reach 150us cycle time with 1us jitter. OPC-UA FX with TSN ethernet is also kinda fussy with 400us cycle time. Do raw sockets make it that much faster? -
@galena its just localhost. May not even be touching the stack/driver. Not sure. The usage will be localhost. Its so someone can created mods that communicate to a local program to do something more sophisticated.
-
retoor15935dPython will not be your problem in networking in speed. It's as fast as C for handling the connections itself, if it doesn't do interpretation. But - it will use 100% CPU and C won't do that.
Related Rants
Been staring at boost::asio to see if I need to thread the code. I am writing a plugin for skse. I am finding that Papyrus has its own threading now. It also has a programmable OnUpdate function that I can schedule every millisecond if I want. So I can have it process the asio context periodically. I think I can get away with non-threaded now. Just use async calls and service the event loop for this. My original plugin for OBSE used threading because there was just not support for it in the scripting at the time. With skse and papyrus I can actually thread things if I want. This really simplifies my plugin quite a bit. The throughput won't be high. I just want to service the networking portion at least every 10th of a second.
rant
papyrus
asio
skyrim
skse