Skip to content
Snippets Groups Projects
  1. Jan 21, 2020
    • Gregory Szorc's avatar
      hgdemandimport: disable on Python 3.5 · c5e0a9b97b8a
      Gregory Szorc authored
      The demand importer functionality isn't working at all on Python 3.5.
      I'm not sure what's wrong.
      
      Since it isn't working, let's disable it completely.
      
      ```
      $ HGRCPATH= hyperfine -w 1 -r 50 -- "~/.pyenv/versions/3.5.9/bin/python ./hg version" \
        "HGDEMANDIMPORT=disable ~/.pyenv/versions/3.5.9/bin/python ./hg version"
      Benchmark #1: ~/.pyenv/versions/3.5.9/bin/python ./hg version
        Time (mean ± σ):     163.7 ms ±   2.2 ms    [User: 148.5 ms, System: 15.7 ms]
        Range (min … max):   161.0 ms … 170.2 ms    50 runs
      
      Benchmark #2: HGDEMANDIMPORT=disable ~/.pyenv/versions/3.5.9/bin/python ./hg version
        Time (mean ± σ):     164.3 ms ±   1.4 ms    [User: 148.2 ms, System: 16.6 ms]
        Range (min … max):   161.4 ms … 169.8 ms    50 runs
      ```
      
      Differential Revision: https://phab.mercurial-scm.org/D7953
      c5e0a9b97b8a
  2. Dec 01, 2019
  3. Nov 08, 2019
    • Augie Fackler's avatar
      cleanup: remove pointless r-prefixes on single-quoted strings · 9f70512ae2cf
      Augie Fackler authored
      This is the promised second step on single-quoted strings. These had
      existed because our source transformer didn't turn r'' into b'', so we
      had tagged some strings as r-strings to get "native" strings on both
      Pythons. Now that the transformer is gone, we can dispense with this
      nonsense.
      
      Methodology:
      
      I ran
      
          hg locate 'set:added() or modified() or clean()' | egrep '.*\.py$'  | xargs egrep --color=never -n  -- \[\^b\]\[\^a-z\]r\'\[\^\'\\\\\]\*\'\[\^\'\
      
      in an emacs grep-mode buffer, and then used a keyboard macro to
      iterate over the results and remove the r prefix as needed.
      
      # skip-blame removing unneeded r prefixes left over from Python 3 migration.
      
      Differential Revision: https://phab.mercurial-scm.org/D7306
      9f70512ae2cf
  4. Nov 07, 2019
    • Augie Fackler's avatar
      cleanup: remove pointless r-prefixes on double-quoted strings · 313e3a279828
      Augie Fackler authored
      This is only double-quoted strings. I'll do single-quoted strings as a
      second step. These had existed because our source transformer didn't
      turn r"" into b"", so we had tagged some strings as r-strings to get
      "native" strings on both Pythons. Now that the transformer is gone, we
      can dispense with this nonsense.
      
      Methodology:
      
      I ran
      
          hg locate 'set:added() or modified() or clean()' | egrep '.*\.py$'  | xargs egrep --color=never -n  -- \[\^a-z\]r\"\[\^\"\\\\\]\*\"\[\^\"\]
      
      in an emacs grep-mode buffer, and then used a keyboard macro to
      iterate over the results and remove the r prefix as needed.
      
      # skip-blame removing unneeded r prefixes left over from Python 3 migration.
      
      Differential Revision: https://phab.mercurial-scm.org/D7305
      313e3a279828
  5. Nov 02, 2019
    • Gregory Szorc's avatar
      demandimportpy3: only use lazy extension loader on Python 3.6+ · 2d31ef3fb494
      Gregory Szorc authored
      There was an inline comment denoting a bug in the lazy extension
      loader on Python 3.5 which prevents it from working there. But the
      code was not conditional on the Python version.
      
      The result of this was a myriad of failures on Python 3.5 due to
      getattr() and friends not working on lazy extension modules.
      
      By making extension modules non-lazy on Python 3.5, we reduce the
      number of test failures from 48 to 22 on that Python version.
      2d31ef3fb494
  6. Oct 06, 2019
  7. Aug 08, 2019
  8. Jun 12, 2019
  9. Sep 01, 2018
  10. Aug 21, 2018
  11. May 06, 2018
    • Gregory Szorc's avatar
      demandimport: make module ignores a set (API) · 670eb4fa1b86
      Gregory Szorc authored
      The list of modules to ignore is used for membership testing. Yet
      it is defined as a list.
      
      Sets are more efficient for membership testing. So this commit converts
      the module list to a set.
      
      Since we took an API hit, I renamed the variable to further clarify
      the change.
      
      This appears to reduce the CPU time for running 300 invocations of
      `hg log -r. -T '{rev}'` on my i7-6700K:
      
      before: 18.64s
      after:  18.44s
      
      Differential Revision: https://phab.mercurial-scm.org/D3440
      670eb4fa1b86
  12. Jan 05, 2018
  13. Aug 22, 2017
  14. Aug 16, 2017
    • Jun Wu's avatar
      demandimport: disable if chg is being used · 3cfc9070245f
      Jun Wu authored
      In chg's case, making modules lazily loaded could actually slow down things
      since chg pre-imports them. Therefore disable demandimport if chg is being
      used.
      
      This is not done by setting `HGDEMANDIMPORT` chg client-side because that
      has side-effects on child processes (hooks, etc).
      
      Differential Revision: https://phab.mercurial-scm.org/D351
      3cfc9070245f
  15. Aug 18, 2017
  16. Jul 16, 2017
  17. Apr 27, 2017
  18. Apr 28, 2017
  19. May 01, 2017
  20. May 21, 2017
Loading