Mercurial > hg
view tests/test-censor2.t @ 50942:75d3306fbc9a stable
tags: avoid expensive access to repo.changelog in a loop
repo.changelog needs some cache invalidation when run on filtered repository.
Accessing it in that loop can be expensive when there is many heads (e.g.
mozilla try and it 25 000 heads).
Note that the loop itself seems useless, but after this patch it no longer take
about ⅛ of the time we spend computing cache for mozilla try.
before :
! wall 0.350994 comb 0.350000 user 0.330000 sys 0.020000 (median of 28)
after :
! wall 0.319520 comb 0.310000 user 0.290000 sys 0.020000 (median of 30)
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 21 Jun 2023 21:57:44 +0200 |
parents | 77b5a190571c |
children | 195ab99cf791 |
line wrap: on
line source
$ cat >> $HGRCPATH <<EOF > [censor] > policy=ignore > EOF $ mkdir r $ cd r $ hg init $ echo secret > target $ hg commit -Am "secret" adding target $ touch bystander $ hg commit -Am "innocent" adding bystander $ echo erased-secret > target $ hg commit -m "erased secret" $ hg censor target --config extensions.censor= -r ".^^" $ hg update ".^" 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat target $ hg update tip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved