Some of the largest Ethereum pools have a support for Stratum mining protocol, they claim that there is about 20% advantage over normal type of protocol. My question is what are those advantages? I understand that having a persistent connection is a huge gain, but why not just go with WS-RPC, which is built-in geth?
You submit your work to the proxy on the same machine you mine on, rather than across the internet to the mining pool. The proxy on your system always has the latest block height information from the mining pool. Therefore you always have less latency (lag time) when submitting work, so you get more work shares counted twords your mining power, which gets you a bigger paycheck.
I assume it is similar to how bitcoin stratum miners work. Which means it's probably just a lower latency and lower overhead transport protocol compared to HTTP (in bitcoin's case), not sure what eth uses. Since the main advantage of eth mining pools is the faster propagation of blocks the 20% number seems at least plausible.
Stratum is usually implemented above json-rpc. Which from a server point of view is very simple to implement. You can listen in a raw socket, each command is a single text line (separated by newlines '\n'). Although it has its limitations, it is enough for a pool to miner communication.
The pool software has to communicate with lots of miners, so they want to make the communication layer as simple as posible.