contrib/base-revsets.txt
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 06 Sep 2018 18:04:27 -0700
changeset 39586 f296c0b366c8
parent 38712 70a4289896b0
child 42140 a4483e380c3e
permissions -rw-r--r--
util: lower water mark when removing nodes after cost limit reached See the inline comment for the reasoning here. This is a pretty common strategy for garbage collectors, other cache-like primtives. The performance impact is substantial: $ hg perflrucachedict --size 4 --gets 1000000 --sets 1000000 --mixed 1000000 --costlimit 100 ! inserts w/ cost limit ! wall 1.659181 comb 1.650000 user 1.650000 sys 0.000000 (best of 7) ! wall 1.722122 comb 1.720000 user 1.720000 sys 0.000000 (best of 6) ! mixed w/ cost limit ! wall 1.139955 comb 1.140000 user 1.140000 sys 0.000000 (best of 9) ! wall 1.182513 comb 1.180000 user 1.180000 sys 0.000000 (best of 9) $ hg perflrucachedict --size 1000 --gets 1000000 --sets 1000000 --mixed 1000000 --costlimit 10000 ! inserts ! wall 0.679546 comb 0.680000 user 0.680000 sys 0.000000 (best of 15) ! sets ! wall 0.825147 comb 0.830000 user 0.830000 sys 0.000000 (best of 13) ! inserts w/ cost limit ! wall 25.105273 comb 25.080000 user 25.080000 sys 0.000000 (best of 3) ! wall 1.724397 comb 1.720000 user 1.720000 sys 0.000000 (best of 6) ! mixed ! wall 0.807096 comb 0.810000 user 0.810000 sys 0.000000 (best of 13) ! mixed w/ cost limit ! wall 12.104470 comb 12.070000 user 12.070000 sys 0.000000 (best of 3) ! wall 1.190563 comb 1.190000 user 1.190000 sys 0.000000 (best of 9) $ hg perflrucachedict --size 1000 --gets 1000000 --sets 1000000 --mixed 1000000 --costlimit 10000 --mixedgetfreq 90 ! inserts ! wall 0.711177 comb 0.710000 user 0.710000 sys 0.000000 (best of 14) ! sets ! wall 0.846992 comb 0.850000 user 0.850000 sys 0.000000 (best of 12) ! inserts w/ cost limit ! wall 25.963028 comb 25.960000 user 25.960000 sys 0.000000 (best of 3) ! wall 2.184311 comb 2.180000 user 2.180000 sys 0.000000 (best of 5) ! mixed ! wall 0.728256 comb 0.730000 user 0.730000 sys 0.000000 (best of 14) ! mixed w/ cost limit ! wall 3.174256 comb 3.170000 user 3.170000 sys 0.000000 (best of 4) ! wall 0.773186 comb 0.770000 user 0.770000 sys 0.000000 (best of 13) $ hg perflrucachedict --size 100000 --gets 1000000 --sets 1000000 --mixed 1000000 --mixedgetfreq 90 --costlimit 5000000 ! gets ! wall 1.191368 comb 1.190000 user 1.190000 sys 0.000000 (best of 9) ! wall 1.195304 comb 1.190000 user 1.190000 sys 0.000000 (best of 9) ! inserts ! wall 0.950995 comb 0.950000 user 0.950000 sys 0.000000 (best of 11) ! inserts w/ cost limit ! wall 1.589732 comb 1.590000 user 1.590000 sys 0.000000 (best of 7) ! sets ! wall 1.094941 comb 1.100000 user 1.090000 sys 0.010000 (best of 9) ! mixed ! wall 0.936420 comb 0.940000 user 0.930000 sys 0.010000 (best of 10) ! mixed w/ cost limit ! wall 0.882780 comb 0.870000 user 0.870000 sys 0.000000 (best of 11) This puts us ~2x slower than caches without cost accounting. And for read-heavy workloads (the prime use cases for caches), performance is nearly identical. In the worst case (pure write workloads with cost accounting enabled), we're looking at ~1.5us per insert on large caches. That seems "fast enough." Differential Revision: https://phab.mercurial-scm.org/D4505
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25608
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
     1
# Base Revsets to be used with revsetbenchmarks.py script
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
     2
#
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
     3
# The goal of this file is to gather a limited amount of revsets that allow a
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
     4
# good coverage of the internal revsets mechanisms.  Revsets included should not
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
     5
# be selected for their individual implementation, but for what they reveal of
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
     6
# the internal implementation of smartsets classes (and their interactions).
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
     7
#
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
     8
# Use and update this file when you change internal implementation of these
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
     9
# smartsets classes. Please include a comment explaining what each of your
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
    10
# addition is testing. Also check if your changes to the smartset class makes
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
    11
# some of the tests inadequate and replace them with a new one testing the same
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
    12
# behavior.
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
    13
#
25609
67a2192dcb64 contrib: introduce an all-revsets.txt file
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25608
diff changeset
    14
# If you want to benchmark revsets predicate itself, check 'all-revsets.txt'.
67a2192dcb64 contrib: introduce an all-revsets.txt file
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25608
diff changeset
    15
#
25608
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
    16
# The current content of this file is currently likely not reaching this goal
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
    17
# entirely, feel free, to audit its content and comment on each revset to
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
    18
# highlight what internal mechanisms they test.
2fea23d035d8 contrib: rename revsetbenchmarks.txt to 'base-revsets.txt'
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25545
diff changeset
    19
20777
77318d3c3b24 benchmark-revset: add full version of benchmarked revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20754
diff changeset
    20
all()
20744
9907b3f79ac2 contrib: added revset examples for benchmarking performance
Lucas Moscovicz <lmoscovicz@fb.com>
parents:
diff changeset
    21
draft()
20777
77318d3c3b24 benchmark-revset: add full version of benchmarked revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20754
diff changeset
    22
::tip
20744
9907b3f79ac2 contrib: added revset examples for benchmarking performance
Lucas Moscovicz <lmoscovicz@fb.com>
parents:
diff changeset
    23
draft() and ::tip
21285
7078ce067367 revsetbenchmark: add `::tip and draft()` to the canonical list
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21204
diff changeset
    24
::tip and draft()
20777
77318d3c3b24 benchmark-revset: add full version of benchmarked revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20754
diff changeset
    25
0::tip
20744
9907b3f79ac2 contrib: added revset examples for benchmarking performance
Lucas Moscovicz <lmoscovicz@fb.com>
parents:
diff changeset
    26
roots(0::tip)
9907b3f79ac2 contrib: added revset examples for benchmarking performance
Lucas Moscovicz <lmoscovicz@fb.com>
parents:
diff changeset
    27
author(lmoscovicz)
20777
77318d3c3b24 benchmark-revset: add full version of benchmarked revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20754
diff changeset
    28
author(mpm)
20744
9907b3f79ac2 contrib: added revset examples for benchmarking performance
Lucas Moscovicz <lmoscovicz@fb.com>
parents:
diff changeset
    29
author(lmoscovicz) or author(mpm)
21295
883e268cb860 revsetbenchmark: add `author(mpm) or author(lmoscovicz)` to the canonical list
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21285
diff changeset
    30
author(mpm) or author(lmoscovicz)
20777
77318d3c3b24 benchmark-revset: add full version of benchmarked revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20754
diff changeset
    31
tip:0
77318d3c3b24 benchmark-revset: add full version of benchmarked revset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20754
diff changeset
    32
0::
22556
480a24ad9f77 revsetbenchmark: allow comments ('#' prefix) in the revset input
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22458
diff changeset
    33
# those two `roots(...)` inputs are close to what phase movement use.
20894
04e1596d5dbd revset: improve _descendants performance
Durham Goode <durham@fb.com>
parents: 20861
diff changeset
    34
roots((tip~100::) - (tip~100::tip))
22556
480a24ad9f77 revsetbenchmark: allow comments ('#' prefix) in the revset input
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22458
diff changeset
    35
roots((0::) - (0::tip))
24923
e5f166961123 revset: narrow the subset using smartset operation in roots()
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22557
diff changeset
    36
42:68 and roots(42:tip)
20861
c2a81aa19980 revsetbenchmark: add entry for ::rev::
Gregory Szorc <gregory.szorc@gmail.com>
parents: 20777
diff changeset
    37
::p1(p1(tip))::
21204
1d7a2771aa36 revset: inline spanset containment check (fix perf regression)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20894
diff changeset
    38
public()
1d7a2771aa36 revset: inline spanset containment check (fix perf regression)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20894
diff changeset
    39
:10000 and public()
1d7a2771aa36 revset: inline spanset containment check (fix perf regression)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20894
diff changeset
    40
draft()
1d7a2771aa36 revset: inline spanset containment check (fix perf regression)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20894
diff changeset
    41
:10000 and draft()
21939
f486001f9d6f revset: optimize baseset.__sub__ (issue4313)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21546
diff changeset
    42
roots((0:tip)::)
22312
8b980fbbd6dc revsetbenchmark: add revset with lazyset subtraction
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21939
diff changeset
    43
(not public() - obsolete())
22451
186fd06283b4 revset: lower weight for _intlist function
Durham Goode <durham@fb.com>
parents: 22450
diff changeset
    44
(_intlist('20000\x0020001')) and merge()
22450
95af98616aa7 revset: make parents() O(number of parents)
Durham Goode <durham@fb.com>
parents: 22449
diff changeset
    45
parents(20000)
22449
da05fe01170b revset: make descendants() lazier
Durham Goode <durham@fb.com>
parents: 22312
diff changeset
    46
(20000::) - (20000)
22557
ace8320156ef revsetbenchmark: add a rebase-related revset to the benchmark list
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22556
diff changeset
    47
# The one below is used by rebase
ace8320156ef revsetbenchmark: add a rebase-related revset to the benchmark list
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22556
diff changeset
    48
(children(ancestor(tip~5, tip)) and ::(tip~5))::
38712
70a4289896b0 revset: add larger test for heads(ancestors(…))
Boris Feld <boris.feld@octobus.net>
parents: 25609
diff changeset
    49
heads(commonancestors(last(head(), 2)))