Matt Harbison <matt_harbison@yahoo.com> [Tue, 18 Dec 2018 14:01:06 -0500] rev 41000
py3: use bytes stdout in test-check-help.t
Setting stdout to binary seemed to have no effect on Windows, as it was
appending a literal '\r' to each topic keyword. This also stops prepending 'b'
to the topic on all platforms as well.
Yuya Nishihara <yuya@tcha.org> [Wed, 31 Oct 2018 22:43:08 +0900] rev 40999
commandserver: preload repository in master server and reuse its file cache
This greatly speeds up repository operation with lots of obsolete markers:
$ ls -lh .hg/store/obsstore
-rw-r--r-- 1 yuya yuya 21M Dec 2 17:55 .hg/store/obsstore
$ time hg log -G -l10 --pager no
(hg) 1.79s user 0.13s system 99% cpu 1.919 total
(chg uncached) 0.00s user 0.01s system 0% cpu 1.328 total
(chg cached) 0.00s user 0.00s system 3% cpu 0.180 total
As you can see, the implementation of the preloader function is highly
experimental. It works, but I'm yet to be sure how things can be organized.
So I don't want to formalize the API at this point.
Yuya Nishihara <yuya@tcha.org> [Wed, 31 Oct 2018 22:19:03 +0900] rev 40998
commandserver: add IPC channel to teach repository path on command finished
The idea is to load recently-used repositories first in the master process,
and fork(). The forked worker can reuse a warm repository if it's preloaded.
There are a couple of ways of in-memory repository caching. They have pros
and cons:
a. "preload by master"
pros: can use a single cache dict, maximizing cache hit rate
cons: need to reload a repo in master process (because worker process
dies per command)
b. "prefork"
pros: can cache a repo without reloading (as worker processes persist)
cons: lower cache hit rate since each worker has to maintain its own cache
c. "shared memory" (or separate key-value store server)
pros: no need to reload a repo in master process, ideally
cons: need to serialize objects to sharable form
Since my primary goal is to get rid of the cost of loading obsstore without
massive rewrites, (c) doesn't work. (b) isn't ideal since it would require
much more SDRAMs than (a). So I take (a).
The idea credits to Jun Wu.
Benjamin Peterson <benjamin@python.org> [Thu, 13 Dec 2018 23:20:28 -0800] rev 40997
upgrade: correct implementation of improvement.__ne__
The "not" operator binds more closely than "==":
>>> not False == False
False
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Dec 2018 16:28:29 +0900] rev 40996
extensions: use ui.log() interface to provide detailed loading information
The output format changes and the messages will be sent to stderr instead of
stdout, but I don't think that matters.
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Dec 2018 16:52:04 +0900] rev 40995
mq: implement log() on dummyui
Otherwise ui.log() in extensions.py would explode.
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Dec 2018 16:24:08 +0900] rev 40994
ui: install logger that sends debug.extensions messages to stderr
This will replace the custom log function introduced at
d58958676b3c
"extensions: add detailed loading information."
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Dec 2018 19:05:42 +0900] rev 40993
blackbox: resurrect recursion guard
If I added ui.log() to hg.repository() function, test-merge-subrepos.t
exploded. The problem is that the blackbox may create new repository instance
while logging is active, and the created repository owns its new ui derived
from the baseui, not from the ui which is processing the active logging.
I tried to work around the issue in ui.log(), but that turned out to be not
easy. We shouldn't globally lock the ui.log() since there may be more than
one active repo/ui instances in threaded environment. We could store the
logging state in thread-local storage, but that seems unnecessarily complex.
So this patch reintroduces the _inlog flag to per-repository logger instances.