hg serve handling local requests (to speedup client response)

dhruva dhruvakm at gmail.com
Sat Oct 18 23:56:27 CDT 2008


Hi,
 For someone issuing a lot of hg commands in succession, we pay a
price on hg having to load up all extensions and do some real work
based on the command and process tear down. It is something like
editor tags, to look up each symbol the complete tag table is loaded
and searched.
 Would having a hg daemon that could serve local client requests by
just creating another thread (or fork on UNIX, not fork and exec or
spawn which will make the process to start from beginning and have the
overhead of having to load all extensions etc...) be useful?
 The is a tags server developed on google projects, similarly to
speedup or avoid startup delays, emacs has daemon and multi-tty
support. My thoughts are influenced by those features.

 A typical usecase:
 On a OS supporting multiple users logged in and using hg:
 Each user can get a thread (with some time out). The user specific
details will be loaded in the thread local storage so that it does not
affect other users. When the user executes the hg client, it just
talks to the running service (through some fast and simple IPC to
proxy the request to the local service). The service handles the
request (may do a setuid/impersonate) and write the o/p to the console
(or to client through IPC which might turn out to be expensive, not
sure about this).
 This would help greatly when someone plans to call hg in a shell
script or batch file to do some sort of code analysis.

-dhruva

-- 
Contents reflect my personal views only!


More information about the Mercurial-devel mailing list