Mercurial > hg
annotate .hgignore @ 50337:47686726545d stable
match: sort patterns before compiling them into a regex
While investigating cripping performance for `hg cat` in some context, I
discovered that, for large inputs, building a regex from out of order patterns
result may result in a *much* slower regex and a much slower associated
matcher's performance.
So we are now sorting the patterns to help the regex engine.
There is more to the story as we rely on regexp more than we should. See the
next changeset for details.
Benchmarks
==========
In the following benchmark we are comparing the `hg cat` and `hg files` run
time when matching against the full list of files in the repository. They are
run:
- without the rust extensions
- with the standard python enfine (so without re2)
sort vs non-sorted - Before this changeset (3f5137543773)
---------------------------------------------------------
###### hg files ###############################################################
### mercurial-2018-08-01-zstd-sparse-revlog
sorted: 0.230092 seconds
shuffled: 0.234235 seconds (+1.80%)
### pypy-2018-08-01-zstd-sparse-revlog
sorted: 0.613567 seconds
shuffled: 0.801880 seconds (+30.69%)
### mozilla-central-2018-08-01-zstd-sparse-revlog
sorted: 62.474221 seconds
shuffled: 1364.180218 seconds (+2083.59%)
### netbeans-2018-08-01-zstd-sparse-revlog
sorted: 21.541828 seconds
shuffled: 172.759857 seconds (+701.97%)
###### hg cat #################################################################
### mercurial-2018-08-01-zstd-sparse-revlog
sorted: 0.764407 seconds
shuffled: 0.768924 seconds
### pypy-2018-08-01-zstd-sparse-revlog
sorted: 2.065220 seconds
shuffled: 2.276388 seconds (+10.22%)
### netbeans-2018-08-01-zstd-sparse-revlog
sorted: 40.967983 seconds
shuffled: 216.388709 seconds (+428.19%)
### mozilla-central-2018-08-01-zstd-sparse-revlog
sorted: 105.228510 seconds
shuffled: 1448.722784 seconds (+1276.74%)
sort vs non-sorted - With this changeset
----------------------------------------
###### hg files ###############################################################
### mercurial-2018-08-01-zstd-sparse-revlog
all-list-pattern-sorted: 0.230069
all-list-pattern-shuffled: 0.231165
### pypy-2018-08-01-zstd-sparse-revlog
all-list-pattern-sorted: 0.616799
all-list-pattern-shuffled: 0.616393
### netbeans-2018-08-01-zstd-sparse-revlog
all-list-pattern-sorted: 21.586773
all-list-pattern-shuffled: 21.908197
### mozilla-central-2018-08-01-zstd-sparse-revlog
all-list-pattern-sorted: 61.279490
all-list-pattern-shuffled: 62.473549
###### hg cat #################################################################
### mercurial-2018-08-01-zstd-sparse-revlog
sorted: 0.763883 seconds
shuffled: 0.765848 seconds
### pypy-2018-08-01-zstd-sparse-revlog
sorted: 2.070498 seconds
shuffled: 2.069197 seconds
### netbeans-2018-08-01-zstd-sparse-revlog
sorted: 41.392423 seconds
shuffled: 41.648689 seconds
### mozilla-central-2018-08-01-zstd-sparse-revlog
sorted: 103.315670 seconds
shuffled: 104.369358 seconds
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 01 Apr 2023 05:57:09 +0200 |
parents | 681b25ea579e |
children | 59820ae507b1 |
rev | line source |
---|---|
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
1 syntax: glob |
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
2 |
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
3 *.elc |
19991
ce5d711475a3
Makefile: do update on a temporary copy of a po file
Simon Heimberg <simohe@besonet.ch>
parents:
19426
diff
changeset
|
4 *.tmp |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
5 *.orig |
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
6 *.rej |
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
7 *~ |
5019
e6cc4d4f5a81
Ignore mergebackup files generated by mpatch
Bryan O'Sullivan <bos@serpentine.com>
parents:
2987
diff
changeset
|
8 *.mergebackup |
2341
dbbe7f72d15a
contrib: add restricted shell.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2151
diff
changeset
|
9 *.o |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
10 *.so |
13643
537899158396
hgignore: ignore dll files generated under cygwin
Craig Leres <leres@ee.lbl.gov>
parents:
13346
diff
changeset
|
11 *.dll |
17115
b52d08b930c5
hgignore: simply ignore all *.exe's everywhere
Adrian Buehlmann <adrian@cadifra.com>
parents:
16537
diff
changeset
|
12 *.exe |
6551 | 13 *.pyd |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
14 *.pyc |
13346
91fe769ac84e
hgignore: ignore more bytecode
Simon Heimberg <simohe@besonet.ch>
parents:
11380
diff
changeset
|
15 *.pyo |
91fe769ac84e
hgignore: ignore more bytecode
Simon Heimberg <simohe@besonet.ch>
parents:
11380
diff
changeset
|
16 *$py.class |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
17 *.swp |
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
18 *.prof |
17274
2426ec322cd1
hgignore: ignore zip files
Adrian Buehlmann <adrian@cadifra.com>
parents:
17115
diff
changeset
|
19 *.zip |
8147
441dc7becd43
win32text: be more careful about rejecting violating changesets
Bryan O'Sullivan <bos@serpentine.com>
parents:
7706
diff
changeset
|
20 \#*\# |
441dc7becd43
win32text: be more careful about rejecting violating changesets
Bryan O'Sullivan <bos@serpentine.com>
parents:
7706
diff
changeset
|
21 .\#* |
39491
4ca7a67c94c8
sparse-revlog: add a test checking revlog deltas for a churning file
Boris Feld <boris.feld@octobus.net>
parents:
38459
diff
changeset
|
22 tests/artifacts/cache/big-file-churn.hg |
2068
4a49daa3a40c
let run-tests run optional code coverage tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1817
diff
changeset
|
23 tests/.coverage* |
27634
a1eff44c432b
tests: write recent run times to a file named tests/.testtimes
Bryan O'Sullivan <bos@serpentine.com>
parents:
22945
diff
changeset
|
24 tests/.testtimes* |
48984
e8138eba17ee
hgignore: ignore .testtimes in more location
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46326
diff
changeset
|
25 # the file is written in the CWD when run-tests is run. |
e8138eba17ee
hgignore: ignore .testtimes in more location
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46326
diff
changeset
|
26 .testtimes |
28255
f75f7d39cca3
testing: generate tests operations using Hypothesis
David R. MacIver <david@drmaciver.com>
parents:
28061
diff
changeset
|
27 tests/.hypothesis |
f75f7d39cca3
testing: generate tests operations using Hypothesis
David R. MacIver <david@drmaciver.com>
parents:
28061
diff
changeset
|
28 tests/hypothesis-generated |
2151
0ce3cd330996
Ignore annotated coverage output of run-tests.py -C
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2068
diff
changeset
|
29 tests/annotated |
35190
bd8875b6473c
run-tests: mechanism to report exceptions during test execution
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33033
diff
changeset
|
30 tests/exceptions |
46326
3e23794b9e1c
run-tests: work around the Windows firewall popup for server processes
Matt Harbison <matt_harbison@yahoo.com>
parents:
46140
diff
changeset
|
31 tests/python3 |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
32 tests/*.err |
15859
44a371823f83
tests: add htmlcov option
Markus Zapke-Gründemann <info@keimlink.de>
parents:
15702
diff
changeset
|
33 tests/htmlcov |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
34 build |
28061
3753d2e1759b
hgignore: ignore chg binary
Yuya Nishihara <yuya@tcha.org>
parents:
27634
diff
changeset
|
35 contrib/chg/chg |
2341
dbbe7f72d15a
contrib: add restricted shell.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2151
diff
changeset
|
36 contrib/hgsh/hgsh |
21874
8da01b6e7b49
contrib/vagrant: use Vagrant for running tests on virtual machine
anatoly techtonik <techtonik@gmail.com>
parents:
21560
diff
changeset
|
37 contrib/vagrant/.vagrant |
49010
681b25ea579e
contrib: add a partial-merge tool for sorted lists (such as Python imports)
Martin von Zweigbergk <martinvonz@google.com>
parents:
48984
diff
changeset
|
38 contrib/merge-lists/target/ |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
39 dist |
21560
a9e1ab2da30d
packaging: move output directory from build/ to packages/
Matt Mackall <mpm@selenic.com>
parents:
19991
diff
changeset
|
40 packages |
19426
e43184680461
doc: make man and html from translated documents
Takumi IINO <trot.thunder@gmail.com>
parents:
17732
diff
changeset
|
41 doc/common.txt |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
42 doc/*.[0-9] |
19426
e43184680461
doc: make man and html from translated documents
Takumi IINO <trot.thunder@gmail.com>
parents:
17732
diff
changeset
|
43 doc/*.[0-9].txt |
1817
e02fea13c69d
Ignore generated documentation
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1270
diff
changeset
|
44 doc/*.[0-9].gendoc.txt |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
45 doc/*.[0-9].{x,ht}ml |
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
46 MANIFEST |
14560
0980239cb20c
hgignore: ignore MANIFEST.in (generated since 2ce7dfe17bc5)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14538
diff
changeset
|
47 MANIFEST.in |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
48 patches |
28430
17b85d739b62
setup: create a module for the modulepolicy
timeless <timeless@mozdev.org>
parents:
28255
diff
changeset
|
49 mercurial/__modulepolicy__.py |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
50 mercurial/__version__.py |
17732
93d97a212559
exewrapper: adapt for legacy HackableMercurial
Adrian Buehlmann <adrian@cadifra.com>
parents:
17274
diff
changeset
|
51 mercurial/hgpythonlib.h |
11380
2bb6dbf04757
Ignore mercurial.egg-info build output
Lee Cantey <lcantey@gmail.com>
parents:
8147
diff
changeset
|
52 mercurial.egg-info |
2987
12d1475b48df
Ignore .DS_Store directories
Lee Cantey <lcantey@gmail.com>
parents:
2386
diff
changeset
|
53 .DS_Store |
5693
5d0b94d3ad0c
.hgignore += tags & cscope files
Kirill Smelkov <kirr@mns.spb.ru>
parents:
5622
diff
changeset
|
54 tags |
5d0b94d3ad0c
.hgignore += tags & cscope files
Kirill Smelkov <kirr@mns.spb.ru>
parents:
5622
diff
changeset
|
55 cscope.* |
45904
e63daff6e8ed
hgignore: add VS Code config
Simon Sapin <simon-commits@exyr.org>
parents:
45054
diff
changeset
|
56 .vscode/* |
22945
3232f92360d4
hgignore: ignore the PyCharm workspace folder
Angel Ezquerra <angel.ezquerra@gmail.com>
parents:
21874
diff
changeset
|
57 .idea/* |
30406
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
29031
diff
changeset
|
58 .asv/* |
43471
8492c6293c31
hgignore: ignore generated pytype stubs
Augie Fackler <augie@google.com>
parents:
39967
diff
changeset
|
59 .pytype/* |
45054
922dbf0df4f1
hgignore: add mypy cache files
Antoine Cezar <antoine.cezar@octobus.net>
parents:
43471
diff
changeset
|
60 .mypy_cache |
7648
02e358a3a8a7
i18n: let Makefile generate i18n/hg.pot
Martin Geisler <mg@daimi.au.dk>
parents:
7439
diff
changeset
|
61 i18n/hg.pot |
7649
a489e3a94443
i18n: new build_mo command for setup.py
Martin Geisler <mg@daimi.au.dk>
parents:
7648
diff
changeset
|
62 locale/*/LC_MESSAGES/hg.mo |
14538
3818c67a501e
setup: add command to generate index of extensions
Yuya Nishihara <yuya@tcha.org>
parents:
13643
diff
changeset
|
63 hgext/__index__.py |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
64 |
35569
964212780daf
rust: implementation of `hg`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35190
diff
changeset
|
65 rust/target/ |
39967
aab43d5861bb
rust-chg: add project skeleton
Yuya Nishihara <yuya@tcha.org>
parents:
39491
diff
changeset
|
66 rust/*/target/ |
35569
964212780daf
rust: implementation of `hg`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35190
diff
changeset
|
67 |
32080
fcddcf442e4f
packaging: add make target for linux wheels
Boris Feld <boris.feld@octobus.net>
parents:
30406
diff
changeset
|
68 # Generated wheels |
fcddcf442e4f
packaging: add make target for linux wheels
Boris Feld <boris.feld@octobus.net>
parents:
30406
diff
changeset
|
69 wheelhouse/ |
fcddcf442e4f
packaging: add make target for linux wheels
Boris Feld <boris.feld@octobus.net>
parents:
30406
diff
changeset
|
70 |
46140
ec14c37958ec
rust: document how to enable debug information in optimized builds
Simon Sapin <simon.sapin@octobus.net>
parents:
45904
diff
changeset
|
71 syntax: rootglob |
ec14c37958ec
rust: document how to enable debug information in optimized builds
Simon Sapin <simon.sapin@octobus.net>
parents:
45904
diff
changeset
|
72 # See Profiling in rust/README.rst |
ec14c37958ec
rust: document how to enable debug information in optimized builds
Simon Sapin <simon.sapin@octobus.net>
parents:
45904
diff
changeset
|
73 .cargo/config |
ec14c37958ec
rust: document how to enable debug information in optimized builds
Simon Sapin <simon.sapin@octobus.net>
parents:
45904
diff
changeset
|
74 |
1270
fc3b41570082
Switch to new syntax for .hgignore files.
Bryan O'Sullivan <bos@serpentine.com>
parents:
981
diff
changeset
|
75 syntax: regexp |
794
cdf61d3d3904
Ignore test error files, protect dot in .pc/
Thomas Arendsen Hein <thomas@intevation.de>
parents:
740
diff
changeset
|
76 ^\.pc/ |
7439
7dd44ad43914
Ignore eclipse droppings
Brendan Cully <brendan@kublai.com>
parents:
6551
diff
changeset
|
77 ^\.(pydev)?project |
15702
64a80204433f
ignore: add files present in the hackable-hg windows distribution
Laurens Holst <laurens.hg@grauw.nl>
parents:
14560
diff
changeset
|
78 |
64a80204433f
ignore: add files present in the hackable-hg windows distribution
Laurens Holst <laurens.hg@grauw.nl>
parents:
14560
diff
changeset
|
79 # hackable windows distribution additions |
16537
5068d0974278
update .hgignore for hackable with Python 2.7
Mads Kiilerich <mads@kiilerich.com>
parents:
15859
diff
changeset
|
80 ^hg-python |
15702
64a80204433f
ignore: add files present in the hackable-hg windows distribution
Laurens Holst <laurens.hg@grauw.nl>
parents:
14560
diff
changeset
|
81 ^hg.py$ |