Mercurial > hg
annotate contrib/asv.conf.json @ 37443:65250a66b55c
revlog: move censor logic into main revlog class
Previously, the revlog class implemented dummy methods for
various censor-related functionality. Revision censoring was
(and will continue to be) only possible on filelog instances.
So filelog implemented these methods to perform something
reasonable.
A problem with implementing censoring on filelog is that
it assumes filelog is a revlog. Upcoming work to formalize
the filelog interface will make this not true.
Furthermore, the censoring logic is security-sensitive. I
think action-at-a-distance with custom implementation of core
revlog APIs in derived classes is a bit dangerous. I think at
a minimum the censor logic should live in revlog.py.
I was tempted to created a "censored revlog" class that
basically pulled these methods out of filelog. But, I wasn't
a huge fan of overriding core methods in child classes. A
reason to do that would be performance. However, the censoring
code only comes into play when:
* hash verification fails
* delta generation
* applying deltas from changegroups
The new code is conditional on an instance attribute. So the
overhead for running the censored code when the revlog isn't
censorable is an attribute lookup. All of these operations are
at least a magnitude slower than a Python attribute lookup. So
there shouldn't be a performance concern.
Differential Revision: https://phab.mercurial-scm.org/D3151
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 05 Apr 2018 16:31:45 -0700 |
parents | cff0f5926797 |
children |
rev | line source |
---|---|
30406
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
1 { |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
2 "version": 1, |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
3 "project": "mercurial", |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
4 "project_url": "https://mercurial-scm.org/", |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
5 "repo": "..", |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
6 "branches": ["default", "stable"], |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
7 "environment_type": "virtualenv", |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
8 "show_commit_url": "https://www.mercurial-scm.org/repo/hg/rev/", |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
9 "benchmark_dir": "benchmarks", |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
10 "env_dir": "../.asv/env", |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
11 "results_dir": "../.asv/results", |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
12 "html_dir": "../.asv/html" |
cff0f5926797
perf: add asv benchmarks
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents:
diff
changeset
|
13 } |