Closed frodrigo closed 2 years ago
The answer is no, but nowadays at least on Linux communication via 127.0.0.1 should not be much slower than using Unix domain sockets anymore. I used http just for the sake of simplicity.
This is currently just a proof of concept implementation without speed optimizations.
I have tried replacing the HTTP communication with a plain TCP socket running a simpe length+data protocol. This reduced processing time in my test to one third of the time needed with the HTTP communication. So there are some significant performance benefits when we don't need to open and close HTTP connections all the time. Using a pipe or Unix Domain socket will probably result in similar numbers. There is an advantage using HTTP because it makes it easier to plug stuff unto it, but the performance savings are large enough to seriously think about changing this.
"So there are some significant performance benefits when we don't need to open and close HTTP connections all the time."
I somewhat expected this. However we will need a simple client for debugging purposes then as curl will no longer work. Maybe netcat or socat will.
I have created a PR #5 with my current test code. This includes a command line test program.
Have you look at the usage of unix pipe to talk with the daemon rather than using a full ip network stack?