In the process of building a python app relying on asynchronous web services, i found myself using crossbar.io in order to make Remote Protocol Calls(RPC) via the package autobahn.
When time came to optimize my app, i tested two configurations for transportation on my router: rawsocket and websocket, and the timings were drastically different !
With a batch of 20 requests, all sent concurrently and handled in threads (so transportation is the main bottleneck), with a payload of size 800Kb ( np.random.random(100000) ) and i got this kind of results :
Websocket: ~ 2.7 s
Rawsocket: ~ 0.6 s
Why is there such a big timing difference ? I came to realize that websocket is “waiting” for a message transmission to finish in order to send the next one, is that different in rawsocket ? What are the differences between rawsockets and websockets in this context and what limitation should i take into account ?