Skip to content
  • Yuya Nishihara's avatar
    patch: stop using cext.diffhelpers · f5833651ad07
    Yuya Nishihara authored
    The C implementation has a couple of memory bugs, and lacks error handling
    which could lead to SEGV. I could fix them one by one (and I mostly finished
    that), but the performance gain provided by cext.diffhelper is quite low.
    Besides, diffhelpers.addlines() calls back Python, linereader.readline(),
    from the innermost loop.
    
      $ hg export -R mozilla-central 0:100 > patch
      $ ls -lh patch
      -rw-r--r--  184M  patch
      $ hg init repo && hg -R repo import patch --time --bypass
      (cext) time: real 34.970 secs (user 32.720+0.000 sys 2.230+0.000)
      (pure) time: real 35.950 secs (user 33.600+0.000 sys 2.330+0.000)
    
    So, let's simply use the pure Python implementation.
    f5833651ad07