Detect typical 'getwork' calls and accelerate them. Bypass the JSON request parser, and the JSON reply builder.
This is split out of JoelKatz's 4diff patch. It needs testing.
Detect typical 'getwork' calls and accelerate them. Bypass the JSON request parser, and the JSON reply builder.
This is split out of JoelKatz's 4diff patch. It needs testing.
How much faster?
Testing with 100 threads of 10,000 getworks each... master: 11m41s (1426/s) master + optimize_FastGetWork: 7m1s (2375/s; 67%) master + threaded_rpc: 8m56s (1869/s; 31%) master + threaded_rpc + rpc_keepalive: 8m14s (2024/s; 42%) master + threaded_rpc + rpc_keepalive + optimize_FastGetWork: 5m41s (2932/s; 105%) master + threaded_rpc + rpc_keepalive + optimize_FastGetWork + optimize_ToHex: 5m32s (3012/s; 111%)
Note that benchmarking this volume of connections (at least without rpc_keepalive) requires tweaking kernel parameters so you don't run out of local ports.
"detect typical getwork" is too much special casing