Commit Graph

193 Commits

Author SHA1 Message Date
Matt Mackall
b42ed84f7a readmarkers: drop a conditional 2015-01-10 21:28:15 -06:00
Matt Mackall
aebd9ab379 readmarkers: add some whitespace 2015-01-10 21:27:29 -06:00
Matt Mackall
00030ac687 readmarkers: combine parent conditionals 2015-01-10 21:25:07 -06:00
Matt Mackall
57b821b575 readmarkers: drop temporary substring assignments
Assignments are expensive in inner loops
2015-01-10 21:24:45 -06:00
Pierre-Yves David
0701311291 obsstore: cache size computation for fm1 node
We have two different types of node type (sha1 and sha256, only sha1 is used
now) and therefor different sizes for them. We now compute the value once
instead of redoing the computation every loop. This has no visible performance
impact.
2014-11-26 23:23:33 -08:00
Pierre-Yves David
0fb7a735b0 obsstore: prefetch struct.calcsize
This function is widely used and worth but be at module level. No specific
performance boost is visible, but this is more consistent.
2014-11-26 23:21:20 -08:00
Pierre-Yves David
ff08bc7b93 obsstore: disable garbage collection during initialization (issue4456)
Python garbage collection is triggered by container creation. So code that
creates a lot of tuples tends to trigger GC a lot. We disable the gc during
obsolescence marker parsing and associated initialization. This provides an
interesting speedup (25%).

Load marker function on my 58758 markers repo:
before: 0.468247 seconds
after:  0.344362 seconds

The benefit is a bit less visible overall. With python2.6 on my system I see:
after:  0.60
before: 0.53

The difference is probably explained by the delaying of a costly GC. (but there
is still a win). Marking involved tuples, lists and dicts as ignorable by the
garbage collector should give us more benefit. But this is another adventure.

Thanks goes to Siddharth Agarwal for the lead.
2014-11-26 16:58:31 -08:00
Pierre-Yves David
629a6bc7d0 obsstore: record data as floating point in fm0 format
For python struct module, "d" is double. But for python string
formating, "d" is integer. We want to preserve the floating point
nature of the data, so we store it in the metadata as floating
point. We use "%r" to make sure we get as many significant digitis as
necessary to restore the float to the exact same value on the other
side.

The fm1 is transmitting the information as float. The lack of this made
fm1-stored markers not survive a round-trip to fm0 leading to duplicated
markers (or two markers very alike).
2014-10-16 14:46:37 -07:00
Durham Goode
73a4415474 obsolete: prevent options from being used without createmarkers
exchange and allowunstable should only be enabled if createmarkers is enabled,
so check for that and raise an exception if that's not the case.
2014-10-14 13:27:00 -07:00
Durham Goode
bbb89aae08 obsolete: add exchange option
This adds an option that enables obsolete marker exchange.
2014-10-14 13:26:01 -07:00
Durham Goode
faa1c33f8b obsolete: add allowunstable option
This option allows the creation of unstable commits. This allows things like
amending in the middle of a stack of commits, etc.
2014-10-14 13:25:13 -07:00
Durham Goode
18f3737f3a obsolete: add createmarkers option
The basic obsolete option is allowing the creation of obsolete markers. This
does not enable other features, such as allowing unstable commits or exchanging
obsolete markers.
2014-10-14 13:23:52 -07:00
Durham Goode
122b7f93b8 obsolete: add readonly flag to obstore constructor
Previously, obstore read the obsolete._enabled flag to determine whether to
allow writes to the obstore. Since obsolete._enabled will be moving into a repo
specific config, we can't read it globally, and therefore must pass the
information into the constructor.
2014-10-14 13:20:31 -07:00
Durham Goode
a10734d5ff obsolete: add isenabled function for option checking
Previously, obsolete used the module level _enabled flag to determine whether it
was on or off. We need a bit more granular control, so we'll be introducing
toggle options. The isenabled() function is how you check if a particular option
is enabled for the given repository.

Future patches will add options such as 'createmarkers', 'allowunstable', and
'exchange' to enable various features of obsolete markers.
2014-10-14 13:17:35 -07:00
Pierre-Yves David
52a52fdcdf obsolete: use format version 1 as the default for obsstore 2014-09-16 17:57:44 -07:00
Pierre-Yves David
febcb6830b obsolete: add a "format.obsstore-version" config option
This option controls what version of the binary format to use when creating a new
obsstore file.

Default is still the old format. No safeguards are currently placed around the
option value, but no clueless users are in danger of harm since it is
undocumented.
2014-09-16 17:52:40 -07:00
Pierre-Yves David
3adb84204d obsolete: introduce a new binary encoding for obsmarkers (version 1)
This new encoding explicitly stores the date and parents allowing a
significantly faster marker decoding. See inline documentation for details.

This format is not yet used to store format on disk. But it will be used in
bundle2 exchange if both side support it. Support for on-disk format is coming
in other changesets.
2014-10-09 00:10:10 -07:00
Pierre-Yves David
2454012c73 obsstore: add a flag for sha256 hashes
We add flag to inform that the marker is using sha256 hashes. As format 0 is not
able to handle sha256 hashes (32 bytes long), we plain crash if we even attempt to
encode a sha256 with it.
2014-10-10 16:43:04 -05:00
Pierre-Yves David
6c00b7eafa obsolete: use uint## in the format documention
This is shorter and kind of more readable for people who care about binary
format.
2014-10-09 00:15:04 -07:00
Pierre-Yves David
7947a20614 obsolete: gather _fm0 meta encoding with other _fm0 code 2014-10-08 22:34:48 -07:00
Pierre-Yves David
db2b475090 obsolete: _rename decodemeta to _fm0decodemeta
This will be format zero specific.
2014-10-08 22:12:06 -07:00
Pierre-Yves David
67a3810eec obsolete: _rename encodemeta to _fm0encodemeta
This will be format zero specific.
2014-10-08 22:11:36 -07:00
Pierre-Yves David
d862c4a145 obsolete: store metadata as a tuple of (key, value) pairs (API)
Different formats will encode metadata in different ways. So we cannot keep the
binary blob in the object anymore. We use a tuple to ensure it is immutable and
hashable.
2014-10-08 22:10:15 -07:00
Pierre-Yves David
a7d9bc3421 obsolete: replace "nb" notation with "num" (for "number")
As requested by Matt Mackall.
2014-10-02 16:57:51 -05:00
Pierre-Yves David
2c1c685c0b obsolete: use version constants in the format mapping 2014-09-16 15:57:51 -07:00
Pierre-Yves David
556c3d9a5e obsolete: use the version argument in encodemarkers
Recent scientific studies show that assigning a variable have no effect on
a unrelated constant. We therefore use the variable where we intended to in the
first place.
2014-09-16 15:56:38 -07:00
Pierre-Yves David
7fe702d01c obsolete: gather all contents related to format version 0 in a single place
All contents includes documentation, constants, and functions, so we
gather all of those things into a single location. The diff is confusing
because it cannot understand what code is semantically moved around in this
grand migration.
2014-09-12 14:41:43 +02:00
Pierre-Yves David
5c32e2e043 obsolete: ensure that getrevs always return a set
When a set of revisions was empty, we were using an empty tuple. We now return an
empty frozenset to ensure the object could be used in an operation that requires a
set.
2014-09-23 12:21:38 -07:00
Pierre-Yves David
1873ea14ec obsolete: properly drop 'date' from metadata
Mistakes were made while resolving rebase conflicts in 92753bcc8aa2. This led to
'date' being preserved in metadata when reading markers from a binary stream.

As a result, some known markers were seen as "new" when pulling. I noticed it
because a no-op pulls from main added about 600 duplicated markers to my
obsstore (for each pull).

I do not believe we need to perform any specific action to actively
de-duplicates existing obsstore. After this fix, duplicated markers will no be
propagated and the few affected repositories can probably deal with duplication (or
people can repull the obsstore from a clone).

As a side effect, we decode metadata only once, reducing the impact of the hack
in fm0 to store extra important data (parents and date).
2014-09-10 14:42:52 +01:00
Pierre-Yves David
9c8ad08d12 obsolete: add a commonversion function
This function returns the highest common version between the locally known
formats and a list of remotely known formats. This is going to be useful to
know what format should be used for exchange.
2014-08-26 11:36:23 +02:00
Pierre-Yves David
fc6088afa7 obsmarker: record the number of new markers in the transaction
This lets hooks be notified about new markers in the repository.
2014-08-25 18:26:56 +02:00
Pierre-Yves David
d8f05095f7 obsolete: make encodemarkers a public function
We'll need access to it for bundle2.
2014-08-25 16:24:40 +02:00
Pierre-Yves David
460e985627 obsolete: move _encodemarkers next to _readmarkers 2014-08-25 16:21:33 +02:00
Pierre-Yves David
73e94f0411 obsstore: store and preserve ondisk version 2014-08-25 16:18:44 +02:00
Pierre-Yves David
150d8e5d5f obsolete: have _readmarkers return the format version
readmarkers is not returning the version of the format it read from. This will
let callers know about the format and allow them to preserve it.
2014-08-25 16:51:51 +02:00
Pierre-Yves David
2be245bb0d obsolete: support for any known obsstore format when reading or writing
We can now read and write any known format. The list of known formats
currently has one element (0). The obsstore itself is not aware of
multiple formats yet and always uses format 0.
2014-08-25 16:16:01 +02:00
Pierre-Yves David
e891429fca obsolete: move _fm0encodeonemarker next to _fm0readmarkers 2014-08-25 16:09:18 +02:00
Pierre-Yves David
59d5970fe3 obsolete: rename _encodeonemarker to _fm0encodeonemarkers
This function encodes markers in version 0 of the format.
2014-08-25 16:43:23 +02:00
Pierre-Yves David
30503ced28 obsolete: extract the part of _readmarkers specific to format version 0
If we are to introduce new formats we need to be able call different
functions for different formats. Creating a function for format
version 0 is the first step.
2014-08-25 14:58:11 +02:00
Pierre-Yves David
104efe6c90 obsolete: rename all _fm to _fm0
This change is because these formats are used for version 0 of the
obsstore format. This is going to be useful in the future when we
introduce new versions of the format.
2014-08-25 14:56:15 +02:00
Pierre-Yves David
7cf82e8c6d obsolete: rename _fnodesize to _fmfnodesize
All variables involved in the obsstore format are prefixed with `_fm`.
`_fnodesize` was the exception. It is now back in line.

This is meaningful as we'll need to distinguish between multiple versions of the
obsstore format.
2014-08-25 14:52:51 +02:00
Pierre-Yves David
1ea986ffcd obsstore: have the mergemarkers method return the number of new markers
The mergemarkers function now returns the number of unknown markers in
the stream that have been added to the obsstore. This is similar to what
`obsstore.add` already does.

The method gains a docstring in the process.
2014-08-21 17:42:50 -07:00
Gregory Szorc
3cffe8cb84 obsolete: avoid slow, generic date parsing
Simple profiling of `hg log -r .` revealed ~18,000 calls to
mercurial.i18n.gettext() on the author's repository. The
culprit was 3 _() calls in util.parsedate() multiplied by
~6000 obsmarkers originating from the parsing of obsmarkers.

Changing the obsmarker code to parse the stored format of
dates instead of going through a generic path eliminates these
gettext() lookups and makes `hg log -r .` execute ~10% faster
on the author's repo. The performance gain is proportional to
the number of obsmarkers.

The author attempted to patch util.parsedate() to avoid the
gettext() lookups. However, that code is whacky and the author
is jet lagged, so the approach was not attempted.
2014-08-29 18:00:44 +02:00
Pierre-Yves David
dfccc53b1c debugobsolete: add a --rev argument
This argument can be used to list markers relevant to a set of revisions. We
add a test for this option and the relevant computation in the same move.
2014-08-19 23:22:44 -07:00
Pierre-Yves David
e3efc0de1b obsolete: rename allmarkers to getmarkers
This function is going to gain a "nodes" argument to filter the markers to the
ones relevant to <nodes> only.
2014-08-20 18:11:23 -07:00
Pierre-Yves David
9b224dd694 obsstore: add relevantmarkers method
We add a ``relevantmarkers`` method to fetch all markers that seem relevant to a
set of nodes. See function documentation about how this set is computed. This
will let us exchange only the markers that seem "relevant" to the set of
changesets related to a push or a pull.

The approach used to define "relevant" has been successfully tested in evolve
for 6 months.
2014-08-19 17:03:10 -07:00
Pierre-Yves David
4bdfd3c696 obsstore: keep track of children information
We use the new `parents` field to build a dictionary of markers that touch
children of a node. This will be used to link prune markers to a set of
exchanged nodes.
2014-08-19 16:53:53 -07:00
Pierre-Yves David
72d4cdd2bd obsstore: drop outdated comment
This comment was associated with a now-defunct line.
2014-08-19 16:46:17 -07:00
Augie Fackler
1705b23c44 obsolete: avoid 2-argument form of enumerate, which was new in Python 2.6 2014-08-20 14:33:59 -04:00
Pierre-Yves David
d03cabd953 obsmarkers: add a parentnodes method to retrieve parent information 2014-08-18 17:14:27 -07:00
Pierre-Yves David
fd1f0f7321 obsstore: also store the 'parents' field on disk
We now store the `parents` field on disk. We use the same strategy as for
`date`: We stick it into the metadata. This is slow and dirty, but this is also
the only way we currently have.

At some point we'll have a new obsstore format to store this properly.
2014-08-18 16:28:44 -07:00
Pierre-Yves David
41733331bc obsstore: drop 'date' from the metadata dictionary
We are extracting the `date` information from the metadata at read time.
However, we failed to remove it from the metadata returned in the markers. This
is now fixed.
2014-08-18 17:06:08 -07:00
Pierre-Yves David
c584b9c277 createmarkers: automatically record the parent of pruned changesets
We need this information to build the set of relevant markers during
exchanges. This can only be done at the `createmarkers` level since
the `obsstore.create` function does not have a repo and therefore has
no access to the parent information.
2014-08-18 16:17:16 -07:00
Pierre-Yves David
767b2c8f0d obsstore: add a parents argument to obsstore.create
We need a way to pass the information to the function. Some guru told me that
what's arguments are made for.
2014-08-18 16:12:29 -07:00
Pierre-Yves David
95fa5b1577 obsstore: add a parents field
This field is intended to store the parent of the precursor. This is useful to
attach pruned changesets to a set of exchanged changesets. We currently just
add the fields with a None value. None stands for "no data recorded".
2014-08-18 16:08:44 -07:00
Pierre-Yves David
21ceed5f91 obsstore: add some documentation about the marker fields
As the number of fields grow, it makes sense to start documenting their contents.
2014-08-19 14:42:08 -07:00
Pierre-Yves David
3b78721608 obsmarker: add date as an explicit field
The markers are now 5-item tuples (concluded by the date). The obsstore.fields
contents have been updated accordingly.

There is no change to the on-disk format yet, so the date has to be extracted
every time we read binary markers and re-injected each team we write them. This
introduces a slowdown that will be solved when a new version of the format is
added. Such a slowdown was already introduced by the evolve extension anyway.
2014-08-19 10:01:06 -07:00
Pierre-Yves David
971ae35ea3 obsstore: add fields attribute to track each field in a marker
We are going to increase the amount of data explicitly stored in obsolescence
markers. This mean we are going to have a longer tuple and some values will be
shuffled around. So we add a ``fields`` attribute to the obsstore class to
keep track of what entry is what. This will be useful for extensions and for
documentation purpose.
2014-08-12 01:49:38 -07:00
Pierre-Yves David
f43f2ce984 obsolete: add a date argument to the createmarkers function
The function is now just passing the value to create markers.
2014-08-14 12:59:48 -07:00
Pierre-Yves David
a9a2652690 obsstore: add an explicit date argument to obsstore.create
The date will become an official field in the markers (and ultimately
in the on-disk format). We start by making it an official argument for
the function.
2014-08-13 22:44:47 -07:00
Pierre-Yves David
3b69b7e067 obsolete: explicitly pass metadata argument using keyword argument
We are about to add more arguments to this function (date, parents, etc).
Passing metadata as a keyword argument gives us more flexibility when adding
them.
2014-08-14 01:53:07 -07:00
Pierre-Yves David
b1789db911 obsmarker: add a flags method
We introduce a proper method to access the flag information.
2014-08-15 09:41:30 -07:00
Matt Mackall
92e0debc2b merge with stable 2014-08-15 11:48:05 -05:00
Mads Kiilerich
5d377a8588 cleanup: avoid local vars shadowing imports
This will mute some pyflakes "import ... shadowed by loop variable" warnings.
2014-08-15 16:20:47 +02:00
Pierre-Yves David
8bf8eb1b78 obsstore.create: add a simple safeguard against cyclic markers
We detect when there is a cycle in the marker itself (precursors being listed
as successors).
2014-08-14 14:59:42 -07:00
Martin Geisler
df032a1bc2 obsolete: fix one-element tuple in module docstring 2014-04-19 20:12:53 +02:00
Martin Geisler
010f4026c6 obsolete: let N denote number of obsoleted changestes in a marker
The number of obsoleted changesets is referred to as N later in the
docstring.
2014-04-19 19:53:46 +02:00
Martin Geisler
3b1788aa56 obsolete: fix language and grammar in module docstring 2014-04-19 19:52:09 +02:00
FUJIWARA Katsunori
87f58fc092 obsolete: add '%' specifier to the format string to avoid TypeError at runtime
Mapping operation on the format string not including any '%'
specifiers causes TypeError at runtime.
2014-04-16 03:05:00 +09:00
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Pierre-Yves David
a61297246c obsolete: extract encoding of marker for pushkey from the list key function
We now have a function taking a list and marker and returning an encoded
version. This will allow obsolescence marker exchange experimentation to easily
pushkey-encode markers to be pushed after selection.
2014-02-27 20:01:28 -08:00
Pierre-Yves David
d8fd55e6c1 obsstore: add a __len__ method
We can already use "for mark in store:" it make sense to allow
"len(store)" too.
2014-02-25 10:32:54 -08:00
Pierre-Yves David
8ed33f95d4 obsstore: create method return True if a marker is actually added
The obsstore method now have a return value. This informs caller about the
actual creation of a new markers. No new markers are created if it would have
been a duplicate.
2014-02-25 10:21:54 -08:00
Mads Kiilerich
92dc407d90 comments: fix minor spelling issues found with spell checker 2014-02-20 02:39:01 +01:00
Pierre-Yves David
1c8096195c createmarkers: allow to pass metadata for a marker only
The `metadata` argument only allow to specify metadata for all new markers. We
extension the format of the `relations` argument to support optional metadata
argument.

The first user of this should be the evolve extension who want to store parent
information of pruned changeset in extra (until we make a second version of the
format)
2014-02-13 17:34:09 -08:00
Pierre-Yves David
098932cf2d obsstore: update create docstring to point to the coder friendly function
The `obsstore` class have a `create` method that create new obsolescence marker
from node. There is another function in the same module `createmarkers`. This
other function is higher level and automatically missing meta data (ultimately
calling the first one)

We add a new comment in the docstring of `obsstore.create` highlighting that
people writing new code probably want to use the top level one.
2014-02-13 17:33:45 -08:00
Pierre-Yves David
33b568da08 pull: move obsolescence marker exchange in the exchange module
The obsolescence marker exchange code was already extracted during a previous
cycle. We are moving the extracted functio in this module. This function will
read and write data in the `pulloperation` object and I prefer to have all core
function collaborating through this object in the same place.

This changeset is pure code movement only. Code change for direct consumption of
the `pulloperation` object will come later.
2014-01-30 17:38:41 -08:00
Pierre-Yves David
97a8524afb push: move obsolescence marker exchange in the exchange module
The obsolescence marker exchange code was already extracted during a previous
cycle. We are moving the extracted functio in this module. This function will
read and write data in the `pushoperation` object and I prefer to have all core
function collaborating through this object in the same place.

This changeset is pure code movement only. Code change for direct consumption of
the `pushoperation` object will come later.
2014-01-30 17:54:47 -08:00
Sean Farley
ef93a468a7 obsolete: clarify documentation for succcessorssets 2014-01-15 18:14:12 -06:00
Pierre-Yves David
bab0fe5a64 obsolete: order of magnitude speedup in _computebumpedset
Reminder: a changeset is said "bumped" if it tries to obsolete a immutable
          changeset.


The previous algorithm for computing bumped changeset was:

    1) Get all public changesets
    2) Find all they successors
    3) Search for stuff that are eligible for being "bumped"
       (mutable and non obsolete)

The entry size of this algorithm is `O(len(public))` which is mostly the same as
`O(len(repo))`. Even this this approach mean fewer obsolescence marker are
traveled, this is not very scalable.

The new algorithm is:

    1) For each potential bumped changesets (non obsolete mutable)
    2) iterate over precursors
    3) if a precursors is public. changeset is bumped

We travel more obsolescence marker, but the entry size is much smaller since
the amount of potential bumped should remains mostly stable with time `O(1)`.

On some confidential gigantic repo this move bumped computation from 15.19s to
0.46s (×33 speedup…). On "smaller" repo (mercurial, cubicweb's review) no
significant gain were seen. The additional traversal of obsolescence marker is
probably probably counter balance the advantage of it.

Other optimisation could be done in the future (eg: sharing precursors cache
for divergence detection)
2013-12-23 15:29:51 -08:00
Pierre-Yves David
777603b25a obsolete: add an allprecursors method mirroring allsuccessors one.
Detection of bumped changeset should use `allprecursors(<mutable>)` instead or
`allsuccessors(<immutable>)` so we need the all precursors function to exists.
2013-12-23 13:36:13 -08:00
Pierre-Yves David
04de18abd8 obsolete: improve allsuccessors doc string
The fact original nodes are also yield is not obvious. We update the docstring
to highlight it.
2013-12-23 13:33:21 -08:00
Pierre-Yves David
9cb9a199aa obsolete: fix bad comment
We cannot afford such extra "with" they are far too pricy.
2013-12-23 13:32:03 -08:00
Augie Fackler
2f26b47577 obsolete: add __eq__ and __hash__ to marker to make set() deduplication work 2013-11-16 20:12:02 -05:00
Pierre-Yves David
1a1b1b5ce2 obsolete: do not accept duplicated marker during exchange
Before this patch, duplicated obsolescence markers could slip into an
obstore if the bookmark was unknown locally and duplicated in the
incoming obsolescence stream.

Existing duplicate markers will not be automatically removed but
they'll stop propagating. Having a few duplicated markers is harmless
and people have been warned evolution is <blink>experimental</blink>
anyway.
2013-11-16 20:31:58 -05:00
Pierre-Yves David
f1f6dad830 obsolete: stop doing membership test on list
According to the Surgeon General, computer should not use list for membership
testing because of the risk of being slow.
2013-11-16 20:34:58 -05:00
Mads Kiilerich
eabc047878 spelling: random spell checker fixes 2013-10-24 01:49:56 +08:00
Augie Fackler
2ae3ed4f92 Backed out changeset c65cc2c5ce84 2013-08-15 21:36:53 -04:00
Dan Villiom Podlaski Christiansen
3f40ec5e82 obsolete: allow passing a revision to successorssets() 2013-08-04 13:43:39 +02:00
Augie Fackler
10a7abe904 obsolete: clean up a couple of docstrings for correctness 2013-07-26 15:59:16 -04:00
Pierre-Yves David
69d3fb6919 obsolete: extract obsolescence marker pulling into a dedicated function
Having a dedicated function will allow us to experiment with other exchange
strategies in an extension. As we have no solid clues about how to do it right,
being able to experiment is vital.

Some transaction tricks are necessary for pull. But nothing too scary.
2013-04-17 11:47:49 +02:00
Pierre-Yves David
0a4431da48 obsolete: extract obsolescence marker pushing into a dedicated function
Having a dedicated function will allows us to experiment with other exchange
strategies in an extension. As we have no solid clues about how to do it right,
being able to experiment is vital.

I intended a more ambitious extraction of push logic, but we are far too
advanced in the release cycle for it.
2013-04-17 11:18:36 +02:00
Pierre-Yves David
ccfae81adc obsolete: extract foreground computation from bookmark.validdest
This foreground logic will be reused by update logic.
2013-04-16 15:16:33 +02:00
Pierre-Yves David
a256234df3 obsolete: ensure all markers have a date
Obsolescence creates a sparse DAG mostly composed of a lot of small independent
chain of markers. Date is the only simple and "reliable" way to sort them. The
existence of a date is now enforced at creation time as I'm more and more
convinced that date will have a key role in obsolescence markers exchange.
2013-02-11 11:20:12 +01:00
Mads Kiilerich
5787baee50 spelling: fix some minor issues found by spell checker 2013-02-10 18:24:29 +01:00
Mads Kiilerich
f289ae22ed obsolete: process markers in a stable order
Using set iteration order gave unstable debugsuccessorssets output with
PYTHONHASHSEED=random.
2013-01-15 02:59:13 +01:00
Pierre-Yves David
bafe2b5542 performance: speedup computation of extinct revisions
In their current state, revset calls can be very costly, as we test
predicates on the entire repository.

This change drops revset calls in favor of direct testing of the phase
of changesets.

Performance test on my Mercurial checkout
- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.

Before:
  ! extinct
  ! wall 0.015124

After:
  ! extinct
  ! wall 0.009424

Performance test on a Mozilla central checkout:
- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.

Before:
  ! extinct
  ! wall 0.032844

After:
  ! extinct
  ! wall 0.000066
2013-01-04 03:16:08 +01:00
Pierre-Yves David
6124831a17 performance: speedup computation of suspended revisions
In their current state, revset calls can be very costly, as we test
predicates on the entire repository.

This change drops a revset call in favor of direct testing of the
phase of changesets.

Performance test on my Mercurial checkout
- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.

Before:
  ! suspended
  ! wall 0.014319

After:
  ! suspended
  ! wall 0.009559

Performance test on a Mozilla central checkout:
- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.

Before:
  ! suspended
  ! wall 0.033373

After:
  ! suspended
  ! wall 0.000053
2013-01-04 03:15:44 +01:00
Pierre-Yves David
2b70610cfb performance: speedup computation of unstable revisions
In their current state, revset calls can be very costly, as we test
predicates on the entire repository.

This change drops revset call in favor of direct testing of the
phase of changesets.

Performance test on my Mercurial checkout
- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.

Before:
  ! unstable
  ! wall 0.017366

After this changes:
  ! unstable
  ! wall 0.008093

Performance test on a Mozilla central checkout:
- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.

Before:
  ! unstable
  ! wall 0.045190

After:
  ! unstable
  ! wall 0.000032
2013-01-04 03:15:21 +01:00
Pierre-Yves David
6f3c5389b0 performance: speedup computation of obsolete revisions
In their current state, revset calls can be very costly as we test
predicates on the entire repository. As obsolete computation is used
by the "hidden" filter, it needs to be very fast.

This changet drops the revset call in favor of direct testing of
the phase of a changeset.

Performance test on my Mercurial checkout

- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.

Before:
  ! obsolete
  ! wall 0.047041

After:
  ! obsolete
  ! wall 0.004590


Performance test on a Mozilla central checkout:

- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.

Before:
  ! obsolete
  ! wall 0.001539

After:
  ! obsolete
  ! wall 0.000017
2013-01-04 03:14:54 +01:00