Impromptu/impromptu — pull request #86 by mdawaffe (2013-12-06 05:33:59+00:00)
Title: Use a Socket Server instead of an HTTP Server

Impromptu just needs to pass strings into and out of the server. HTTP is overkill.

In theory, an HTTP server is able to consume and produce richer data. The Impromptu client, though, never uses what richness the server currently produces (HTTP status codes, for example).

Pro: Slightly faster without the HTTP overhead. The transport is about twice as fast with TCP Sockets, and almost 2.5 times faster with Unix sockets. Most of the time, though, isn't spent on transport: it's spent on calculating the prompt. On my machine with the default prompt, this branch is ~5% faster, so it's not a huge win.

Timed with:
~~~bash
$ time for i in $( seq 0 9 ); do bin/impromptu-client &> /dev/null; done
~~~

Con: Less extensible.

Implementation:
* Replace HTTP server with Socket server (TCP or Unix)
* Replace `curl` client with `nc` client. As written, Unix sockets only work for environments with an `nc` command that accepts a `-U` flag.