rusefi / rusefi

rusefi - GPL internal combustion engine control unit
http://rusefi.com
Other
796 stars 257 forks source link

simulator TCP data rate #4203

Open rusefillc opened 2 years ago

rusefillc commented 2 years ago

Windows 11 rusefi_simulator.exe

TS TCP connector shows only 45Hz runtime data rate I was hoping for more?!

See also #4202

rusefillc commented 2 years ago

image

image

rusefillc commented 2 years ago

next step: run a test with rusEFI code as client instead of TS

rusefillc commented 2 years ago

let's start from a java to java TCP/IP test as baseline

I 220528 172135.930 [sandboxTCP reader1] ByteReader - sandboxRunning TCP connection loop
Executed 10000 getSignature in 859ms
Per-signature: 0.0859ms
Executed 10000 GetProtocol in 703ms
Per-GetProtocol: 0.0703ms
rusefillc commented 2 years ago

TS talking to TcpServerSandbox is five times faster than TS talking to rusefi_simulator.exe

image

rusefillc commented 2 years ago

TcpClientSandbox talking to rusefi_simulator.exe

Executed 10000 getSignature in 8250ms Per-signature: 0.825ms Executed 10000 GetProtocol in 1140ms Per-GetProtocol: 0.114ms

rusefillc commented 2 years ago

TcpClientSandbox talking to TcpServerSandbox getSignature is much faster while GetProtocol is more or less same speed

Executed 10000 getSignature in 1034ms Per-signature: 0.1034ms Executed 10000 GetProtocol in 904ms Per-GetProtocol: 0.0904ms

rusefillc commented 2 years ago

@dron0gus says disable MSG_WAITALL see MSG_DONTWAIT

https://stackoverflow.com/questions/55034112/c-disable-delayed-ack-on-windows https://learn.microsoft.com/en-us/troubleshoot/windows/win32/data-segment-tcp-winsock https://stackoverflow.com/questions/17842406/how-would-one-disable-nagles-algorithm-in-linux