mmapindex: set default to 1MB
mmapping index is more efficient if we only need a small part of it.
The 1MB value has been picked arbitrarily, a lower value might be better.
On a large repository with a 60MB index, we see the following performance
gain:
hg perfindex
before: ! wall 0.032023 comb 0.040000 user 0.000000 sys 0.040000 (best of 100)
after: ! wall 0.000196 comb 0.000000 user 0.000000 sys 0.000000 (best of 1060)
The speed boost benefit all cases, including the one where the full index
needs to be parsed.
hg perfindex --rev 0
before: ! wall 0.040673 comb 0.030000 user 0.000000 sys 0.030000 (best of 100)
after ! wall 0.010713 comb 0.020000 user 0.010000 sys 0.010000 (best of 212)
This gain reflect in higher level operation:
hg perfbookmarks --clear-revlogs
before: ! wall 0.161339 comb 0.160000 user 0.130000 sys 0.030000 (best of 56)
after: ! wall 0.123228 comb 0.120000 user 0.120000 sys 0.000000 (best of 68)
https://bz.mercurial-scm.org/1306
Initialize remote repo with branches:
$ hg init remote
$ cd remote
$ echo a > a
$ hg ci -Ama
adding a
$ hg branch br
marked working directory as branch br
(branches are permanent and global, did you want a bookmark?)
$ hg ci -Amb
$ echo c > c
$ hg ci -Amc
adding c
$ hg log
changeset: 2:ae3d9c30ec50
branch: br
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: c
changeset: 1:3f7f930ca414
branch: br
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: b
changeset: 0:cb9a9f314b8b
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
$ cd ..
Try cloning -r branch:
$ hg clone -rbr remote local1
adding changesets
adding manifests
adding file changes
added 3 changesets with 2 changes to 2 files
new changesets cb9a9f314b8b:ae3d9c30ec50
updating to branch br
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R local1 parents
changeset: 2:ae3d9c30ec50
branch: br
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: c
Try cloning -rother clone#branch:
$ hg clone -r0 remote#br local2
adding changesets
adding manifests
adding file changes
added 3 changesets with 2 changes to 2 files
new changesets cb9a9f314b8b:ae3d9c30ec50
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R local2 parents
changeset: 0:cb9a9f314b8b
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
Try cloning -r1 clone#branch:
$ hg clone -r1 remote#br local3
adding changesets
adding manifests
adding file changes
added 3 changesets with 2 changes to 2 files
new changesets cb9a9f314b8b:ae3d9c30ec50
updating to branch br
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R local3 parents
changeset: 1:3f7f930ca414
branch: br
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: b