Skip to content
Snippets Groups Projects
  1. Oct 14, 2019
    • Yuya Nishihara's avatar
      rust-cpython: prepare for writing tests that require libpython · 8d432d3a2d7c
      Yuya Nishihara authored
      What I wanted is to disable the "cpython/extension-module<ver>" feature
      while building tests executable, but that seems not doable. Instead,
      this patch adds new features dedicated for tests.
      
      The make rule is extracted so that we can easily run cargo tests.
      
      Added a minimal test of ref-sharing as an example. More tests will follow.
      8d432d3a2d7c
  2. Oct 05, 2019
  3. Sep 21, 2019
  4. Sep 15, 2019
    • Yuya Nishihara's avatar
      rust-cpython: make PyLeakedRef operations relatively safe · ffc1fbd7d1f5
      Yuya Nishihara authored
      This patch encapsulates the access to the leaked reference to make most
      leaked-ref operations safe. The only exception is leaked_ref.map(). I
      couldn't figure out how to allow arbitrary map operation safely over an
      unsafe static reference. See the docstring and inline comment for details.
      
      Now leak_immutable() can be safely implemented as the PyLeakedRef owns
      its inner data.
      ffc1fbd7d1f5
    • Yuya Nishihara's avatar
      rust-cpython: put leaked reference in PyLeakedRef · ce6dd1cee4c8
      Yuya Nishihara authored
      The next patch will make PyLeakedRef manage the lifetime of the underlying
      object. leak_handle.data.take() will be removed soon.
      ce6dd1cee4c8
  5. Oct 18, 2019
    • Gregory Szorc's avatar
      run-tests: make code coverage work on Python 3 · 96eb9ef777a8
      Gregory Szorc authored
      This code path was obviously not tested on Python 3 because it
      blew up in several places due to str/bytes mismatch.
      
      For internal code, we normalize paths to bytes.
      
      For code calling into `coverage`, we normalize paths to str,
      which is what `coverage` seems to expect.
      
      After this, `run-tests.py -H` works on Python 3!
      
      Differential Revision: https://phab.mercurial-scm.org/D7133
      96eb9ef777a8
  6. Oct 17, 2019
  7. Oct 16, 2019
  8. Oct 17, 2019
  9. Oct 11, 2019
  10. Oct 16, 2019
  11. Oct 08, 2019
  12. Oct 15, 2019
  13. Oct 11, 2019
    • Raphaël Gomès's avatar
      rust-dirstate-status: add first Rust implementation of `dirstate.status` · 99394e6c5d12
      Raphaël Gomès authored
      Note: This patch also added the rayon crate as a Cargo dependency. It will
      help us immensely in making Rust code parallel and easy to maintain. It is
      a stable, well-known, and supported crate maintained by people on the Rust
      team.
      
      The current `dirstate.status` method has grown over the years through bug
      reports and new features to the point where it got too big and too complex.
      
      This series does not yet improve the logic, but adds a Rust fast-path to speed
      up certain cases.
      
      Tested on mozilla-try-2019-02-18 with zstd compression:
          - `hg diff` on an empty working copy:
              - c: 1.64(+-)0.04s
              - rust+c before this change: 2.84(+-)0.1s
              - rust+c: 849(+-)40ms
          - `hg commit` when creating a file:
              - c: 5.960s
              - rust+c before this change: 5.828s
              - rust+c: 4.668s
          - `hg commit` when updating a file:
              - c: 4.866s
              - rust+c before this change: 4.371s
              - rust+c: 3.855s
          - `hg status -mard`
              - c: 1.82(+-)0.04s
              - rust+c before this change: 2.64(+-)0.1s
              - rust+c: 896(+-)30ms
      
      The numbers are clear: the current Rust `dirstatemap` implementation is super
      slow, its performance needs to be addressed.
      This will be done in a future series, immediately after this one, with the goal
      of getting Rust to be at least to the speed of the Python + C implementation
      in all cases before the 5.2 freeze. At worse, we gate dirstatemap to only be used
      in those cases.
      
      Cases where the fast-path is not executed:
          - for commands that need ignore support (`status`, for example)
          - if subrepos are found (should not be hard to add, but winter is coming)
          - any other matcher than an `alwaysmatcher`, like patterns, etc.
          - with extensions like `sparse` and `fsmonitor`
      
      The next step after this is to rethink the logic to be closer to
      Jane Street's Valentin Gatien-Baron's Rust fast-path which does a lot less
      work when possible.
      
      Differential Revision: https://phab.mercurial-scm.org/D7058
      99394e6c5d12
  14. Oct 06, 2019
  15. Sep 30, 2019
    • Georges Racinet's avatar
      rust-cpython: removed now useless py_set() conversion · 33fe96a5c522
      Georges Racinet authored
      In rust-cpython 0.3.0, HashSets implement the appropriate
      ToPythonObject, we can therefore get rid of this hacky conversion.
      
      There still remains an inefficiency in `MissingAncestors.bases()`:
      we have to clone, because `to_py_object()` requires full ownership.
      However:
      
      - the only use case outside of unit tests used to be from
      `setdiscovery.partialdiscovery` which is now fully implemented
      in Rust.
      - it's not worse than what `py_set()` used to do
      
      Differential Revision: https://phab.mercurial-scm.org/D7120
      33fe96a5c522
  16. Oct 16, 2019
  17. Oct 06, 2019
  18. Sep 12, 2019
  19. Oct 10, 2019
    • Ian Moody's avatar
      phabricator: update hgmatcher to cope with the new data format · a4da1c3b82ab
      Ian Moody authored
      The new conduit format can't be matched by the existing matcher since it shifts
      all the data into an urlencoded string of JSON, the order of which isn't stable
      between runs.  Instead detect JSON values of params and load them into python
      dicts, which python will then naturally deep-equal compare.
      
      Differential Revision: https://phab.mercurial-scm.org/D7055
      a4da1c3b82ab
    • Ian Moody's avatar
      phabricator: treat non-utf-8 text files as binary as phabricator requires · 06a33a501aa2
      Ian Moody authored
      Phabricator can't cope with text files that are not UTF-8, so requires them to
      be submitted as binary files instead.  This has the unfortunate effect of
      making them practically unreviewable in Phabricator since it will only display
      the separate versions of the file in other views, not a diff.  `phabread`ing
      such submissions are similar, since it will just output the binary patch, but
      `hg import` copes with it fine and `hg diff` afterwards will show the actual
      changes.  It is still a marked improvement over trying to submit them as text,
      which just leads to corruption (Phabricator will either output ? or HTML
      entities for non-UTF-8 characters, depending on context).
      
      Running decode on the whole file like this seems slightly unfortunate, but I'm
      not aware of a better way.
      Needs to be done to p1() version as well to detect conversions to UTF-8.
      
      Differential Revision: https://phab.mercurial-scm.org/D7054
      06a33a501aa2
  20. Oct 06, 2019
  21. Oct 10, 2019
  22. Oct 12, 2019
  23. Oct 06, 2019
    • Ian Moody's avatar
      phabricator: add addadded function · d5d1edf66091
      Ian Moody authored
      This is the most complicated part of the new code, and is responsible for
      adding all added files, whether brand new, copied, or moved.  This also
      includes creating the phabchanges for the original files that have been moved
      or copied from, since they might need their awayPaths and type updating if
      multiple copies are involved.
      
      Differential Revision: https://phab.mercurial-scm.org/D7050
      d5d1edf66091
  24. Oct 02, 2019
    • Pierre-Yves David's avatar
      sidedatacopies: directly fetch copies information from sidedata · 675c776fbcd1
      Pierre-Yves David authored
      When using the sidedata mode, we don't need a complicated and expensive
      `context` object. Instead we directly fetch copies information from the
      sidedata (through a changelogrevision object). More optimisations coming.
      
      revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29
      filelog: ! wall 3.679613 comb 3.680000 user 3.580000 sys 0.100000 (median of 3)
      base:    ! wall 8.884369 comb 8.880000 user 8.850000 sys 0.030000 (median of 3)
      before:  ! wall 4.681985 comb 4.680000 user 4.640000 sys 0.040000 (median of 3)
      after:   ! wall 3.955894 comb 3.950000 user 3.940000 sys 0.010000 (median of 3)
      revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2
      filelog: ! wall 0.003357 comb 0.010000 user 0.010000 sys 0.000000 (median of 781)
      base:    ! wall 12.398524 comb 12.400000 user 12.330000 sys 0.070000 (median of 3)
      before:  ! wall 6.459592 comb 6.470000 user 6.390000 sys 0.080000 (median of 3)
      after:   ! wall 5.505774 comb 5.500000 user 5.410000 sys 0.090000 (median of 3)
      revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0
      filelog: ! wall 2.754687 comb 2.760000 user 2.650000 sys 0.110000 (median of 4)
      base:    ! wall 1.423166 comb 1.420000 user 1.400000 sys 0.020000 (median of 8)
      before:  ! wall 0.961048 comb 0.960000 user 0.940000 sys 0.020000 (median of 11)
      after:   ! wall 0.882950 comb 0.880000 user 0.880000 sys 0.000000 (median of 11)
      revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f
      filelog: ! wall 1.552293 comb 1.550000 user 1.510000 sys 0.040000 (median of 6
      base:    ! wall 0.022662 comb 0.020000 user 0.020000 sys 0.000000 (median of 128)
      before:  ! wall 0.021649 comb 0.020000 user 0.020000 sys 0.000000 (median of 135)
      after:   ! wall 0.020951 comb 0.020000 user 0.020000 sys 0.000000 (median of 141)
      revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63
      filelog: ! wall 1.500983 comb 1.500000 user 1.420000 sys 0.080000 (median of 7)
      base:    ! wall 0.006956 comb 0.010000 user 0.010000 sys 0.000000 (median of 392)
      before:  ! wall 0.004022 comb 0.000000 user 0.000000 sys 0.000000 (median of 735)
      after:   ! wall 0.003988 comb 0.000000 user 0.000000 sys 0.000000 (median of 736)
      revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e
      filelog: ! wall 0.011745 comb 0.020000 user 0.020000 sys 0.000000 (median of 250)
      base:    ! wall 0.000156 comb 0.000000 user 0.000000 sys 0.000000 (median of 17180)
      before:  ! wall 0.000118 comb 0.000000 user 0.000000 sys 0.000000 (median of 19170)
      after:   ! wall 0.000097 comb 0.000000 user 0.000000 sys 0.000000 (median of 27276)
      revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe
      filelog: ! wall 3.228230 comb 3.230000 user 3.110000 sys 0.120000 (median of 4)
      base:    ! wall 0.997640 comb 1.000000 user 0.980000 sys 0.020000 (median of 10)
      before:  ! wall 0.679500 comb 0.680000 user 0.680000 sys 0.000000 (median of 15)
      after:   ! wall 0.596779 comb 0.600000 user 0.600000 sys 0.000000 (median of 17)
      revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d
      filelog: ! wall 1.052501 comb 1.060000 user 1.040000 sys 0.020000 (median of 10
      base:    ! wall 0.214519 comb 0.220000 user 0.220000 sys 0.000000 (median of 45)
      before:  ! wall 0.149675 comb 0.150000 user 0.150000 sys 0.000000 (median of 66)
      after:   ! wall 0.130786 comb 0.130000 user 0.130000 sys 0.000000 (median of 75)
      
      Differential Revision: https://phab.mercurial-scm.org/D7072
      675c776fbcd1
  25. Oct 15, 2019
    • Pierre-Yves David's avatar
      copies: use an unfiltered repository for the changeset centric algorithm · 00de32aa834e
      Pierre-Yves David authored
      Since the algorithm work form heads to ancestors, we don't need to check
      filtering for anything but the two entries.
      
      Using an unfiltered version is noticeably more efficient.
      
      Some timing on the pypy repo:
      revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29
      before: ! wall 2.717861 comb 2.720000 user 2.700000 sys 0.020000 (median of 10)
      after:  ! wall 2.582204 comb 2.580000 user 2.560000 sys 0.020000 (median of 10)
      revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2
      before: ! wall 4.003146 comb 4.010000 user 3.970000 sys 0.040000 (median of 10)
      after:  ! wall 3.814613 comb 3.810000 user 3.760000 sys 0.050000 (median of 10)
      revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0
      before: ! wall 0.704204 comb 0.700000 user 0.700000 sys 0.000000 (median of 13)
      after:  ! wall 0.657387 comb 0.650000 user 0.640000 sys 0.010000 (best of 14)
      revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f
      before: ! wall 0.013493 comb 0.020000 user 0.020000 sys 0.000000 (median of 219)
      after:  ! wall 0.013523 comb 0.020000 user 0.020000 sys 0.000000 (median of 218)
      revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63
      before: ! wall 0.003017 comb 0.000000 user 0.000000 sys 0.000000 (median of 985)
      after:  ! wall 0.002876 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000)
      revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e
      before: ! wall 0.000073 comb 0.000000 user 0.000000 sys 0.000000 (median of 12672)
      after:  ! wall 0.000082 comb 0.000000 user 0.000000 sys 0.000000 (median of 11456)
      revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe
      before: ! wall 0.478061 comb 0.470000 user 0.470000 sys 0.000000 (median of 19)
      after:  ! wall 0.452420 comb 0.450000 user 0.450000 sys 0.000000 (median of 21)
      revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d
      before: ! wall 0.116015 comb 0.110000 user 0.110000 sys 0.000000 (median of 84)
      after:  ! wall 0.109153 comb 0.100000 user 0.100000 sys 0.000000 (median of 90)
      
      Differential Revision: https://phab.mercurial-scm.org/D7123
      00de32aa834e
  26. Oct 02, 2019
  27. Oct 16, 2019
    • Pierre-Yves David's avatar
      copies: avoid instancing more changectx to access parent revisions · 181d28ba05da
      Pierre-Yves David authored
      We just need to know the revision numbers of the parents, creating full context
      is needlessly expensive.
      
      This provide a small, but noticeable performance boost.
      
      revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29
      before: ! wall 2.885636 comb 2.900000 user 2.870000 sys 0.030000 (median of 10)
      after:  ! wall 2.702270 comb 2.710000 user 2.690000 sys 0.020000 (median of 10)
      revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2
      before: ! wall 4.298271 comb 4.290000 user 4.240000 sys 0.050000 (median of 10)
      after:  ! wall 3.976610 comb 3.970000 user 3.920000 sys 0.050000 (median of 10)
      revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0
      before: ! wall 0.773397 comb 0.770000 user 0.770000 sys 0.000000 (median of 11)
      after:  ! wall 0.701634 comb 0.700000 user 0.700000 sys 0.000000 (median of 13)
      revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f
      before: ! wall 0.013585 comb 0.010000 user 0.010000 sys 0.000000 (median of 217)
      after:  ! wall 0.013550 comb 0.010000 user 0.010000 sys 0.000000 (median of 218)
      revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63
      before: ! wall 0.003202 comb 0.000000 user 0.000000 sys 0.000000 (median of 929)
      after:  ! wall 0.002993 comb 0.010000 user 0.010000 sys 0.000000 (median of 992)
      revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e
      before: ! wall 0.000077 comb 0.000000 user 0.000000 sys 0.000000 (median of 12060)
      after:  ! wall 0.000072 comb 0.000000 user 0.000000 sys 0.000000 (median of 12804)
      revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe
      before: ! wall 0.510614 comb 0.500000 user 0.500000 sys 0.000000 (median of 18)
      after:  ! wall 0.473681 comb 0.470000 user 0.470000 sys 0.000000 (median of 20)
      revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d
      before: ! wall 0.126552 comb 0.130000 user 0.130000 sys 0.000000 (median of 77)
      after:  ! wall 0.115240 comb 0.110000 user 0.110000 sys 0.000000 (median of 85)
      
      Differential Revision: https://phab.mercurial-scm.org/D7122
      181d28ba05da
    • Pierre-Yves David's avatar
      copies: get copies information directly from _copies · 82dabad535d2
      Pierre-Yves David authored
      Performance measurement does not show any significant performance movement. This
      is not surprising since p1copies() code is `self._copies[0]`.
      
      Differential Revision: https://phab.mercurial-scm.org/D7121
      82dabad535d2
  28. Oct 02, 2019
    • Pierre-Yves David's avatar
      copies: simplify the handling of merges · 32187ae9eeb3
      Pierre-Yves David authored
      Instead of stacking copies for both parent on the head, we move copies outside
      of the heap into a dedicated dictionary. The two side of merge can we merged
      sooner, making the algorithm simpler.
      
      This simplicity reflect in the heap structure and speed up the execution for
      copies involving a large amount of merges.
      
      Here are timing for perfpathcopies of multiple revision pairs.
      - filelog: timing using filelog (with the introrev condition dropped)
      - base:    this series base
      - before:  the parent of this changeset
      - after:   this changeset
      
      revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29
      filelog: ! wall 3.679613 comb 3.680000 user 3.580000 sys 0.100000 (median of 3)
      base:    ! wall 8.884369 comb 8.880000 user 8.850000 sys 0.030000 (median of 3)
      before:  ! wall 8.443747 comb 8.420000 user 8.410000 sys 0.010000 (median of 3)
      after:   ! wall 4.697917 comb 4.690000 user 4.660000 sys 0.030000 (median of 3)
      revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2
      filelog: ! wall 0.003357 comb 0.010000 user 0.010000 sys 0.000000 (median of 781)
      base:    ! wall 12.398524 comb 12.400000 user 12.330000 sys 0.070000 (median of 3)
      before:  ! wall 10.852593 comb 10.850000 user 10.800000 sys 0.050000 (median of 3)
      after:   ! wall 6.750832 comb 6.750000 user 6.640000 sys 0.110000 (median of 3)
      revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0
      filelog: ! wall 2.754687 comb 2.760000 user 2.650000 sys 0.110000 (median of 4)
      base:    ! wall 1.423166 comb 1.420000 user 1.400000 sys 0.020000 (median of 8)
      before:  ! wall 1.068041 comb 1.060000 user 1.050000 sys 0.010000 (median of 10)
      after:   ! wall 1.045916 comb 1.050000 user 1.040000 sys 0.010000 (median of 10)
      revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f
      filelog: ! wall 1.552293 comb 1.550000 user 1.510000 sys 0.040000 (median of 6
      base:    ! wall 0.022662 comb 0.020000 user 0.020000 sys 0.000000 (median of 128)
      before:  ! wall 0.021111 comb 0.020000 user 0.020000 sys 0.000000 (median of 139)
      after:   ! wall 0.021577 comb 0.020000 user 0.020000 sys 0.000000 (median of 138)
      revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63
      filelog: ! wall 1.500983 comb 1.500000 user 1.420000 sys 0.080000 (median of 7)
      base:    ! wall 0.006956 comb 0.010000 user 0.010000 sys 0.000000 (median of 392)
      before:  ! wall 0.004356 comb 0.010000 user 0.010000 sys 0.000000 (median of 675)
      after:   ! wall 0.004329 comb 0.000000 user 0.000000 sys 0.000000 (median of 682)
      revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e
      filelog: ! wall 0.011745 comb 0.020000 user 0.020000 sys 0.000000 (median of 250)
      base:    ! wall 0.000156 comb 0.000000 user 0.000000 sys 0.000000 (median of 17180)
      before:  ! wall 0.000100 comb 0.000000 user 0.000000 sys 0.000000 (median of 26912)
      after:   ! wall 0.000105 comb 0.000000 user 0.000000 sys 0.000000 (median of 25689)
      revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe
      filelog: ! wall 3.228230 comb 3.230000 user 3.110000 sys 0.120000 (median of 4)
      base:    ! wall 0.997640 comb 1.000000 user 0.980000 sys 0.020000 (median of 10)
      before:  ! wall 0.778291 comb 0.780000 user 0.780000 sys 0.000000 (median of 13)
      after:   ! wall 0.706594 comb 0.710000 user 0.710000 sys 0.000000 (median of 15)
      revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d
      filelog: ! wall 1.052501 comb 1.060000 user 1.040000 sys 0.020000 (median of 10
      base:    ! wall 0.214519 comb 0.220000 user 0.220000 sys 0.000000 (median of 45)
      before:  ! wall 0.160804 comb 0.160000 user 0.160000 sys 0.000000 (median of 62)
      after:   ! wall 0.163736 comb 0.160000 user 0.160000 sys 0.000000 (median of 60)
      
      Differential Revision: https://phab.mercurial-scm.org/D7069
      32187ae9eeb3
  29. Oct 07, 2019
  30. Oct 16, 2019
Loading