.arcconfig
author Jun Wu <quark@fb.com>
Wed, 27 Sep 2017 18:07:48 -0700
changeset 34357 c41444a39de2
parent 33583 b2c27d84f05c
child 44128 ff396501e841
permissions -rw-r--r--
config: use copy-on-write to improve copy performance Previously, chg's `verify` call could take 30+ms loading and checking new config files. With one socket redirection, that adds up to around 70ms, which is a lot for fast commands (ex. `bookmark --hidden`). When investigating closer, A lot of time was spent on actually spent on ui copying, which is mainly about `config.config` and `dict` copying. This patch makes that 20x faster by adopting copy-on-write. The copy-on-write is performed at config section level. Before: In [1]: %timeit ui.copy() 100 loops, best of 3: 2.32 ms per loop After: In [1]: %timeit ui.copy() 10000 loops, best of 3: 128 us per loop 2ms may look not that bad, but it adds up pretty quickly with multiple calls. A typical chg run may call it 4 times, which is about 10ms. Differential Revision: https://phab.mercurial-scm.org/D808

{
    "conduit_uri": "https://phab.mercurial-scm.org/api",
    "repository.callsign": "HG",
    "arc.land.onto.default": "@",
    "base": "hg:.^"
}