Carl Friedrich Bolz-Tereick pushed to branch branch/default at PyPy / pypy


Commits:
2dd2c855 by Carl Friedrich Bolz-Tereick at 2021-02-25T09:53:25+01:00
copy an optimization from CPython: when the search string of str.replace and
str.split doesn't occur in the string, don't create a copy but just 
reuse self.

--HG--
branch : string-algorithmic-optimizations

- - - - -
3a354ad3 by Carl Friedrich Bolz-Tereick at 2021-02-25T10:10:23+01:00
second optimization: have a fast path in replace for single character strings
here too

--HG--
branch : string-algorithmic-optimizations

- - - - -
5e22ae11 by Carl Friedrich Bolz-Tereick at 2021-02-25T13:02:10+01:00
fix a tiny performance bug in our string search that we ported from cpython.
the condition is a bit complicated:

- we need a last character that is unique in the string
- we are at a position in the string that matches the last character, but a
  previous char is a mismatch
- the next char in the haystack is in the bloom filter

if all this is met, we want to skip a whole needle length, not len(needle) - 1

this was pointed out by Tim Peters here: https://bugs.python.org/msg378301

--HG--
branch : string-algorithmic-optimizations

- - - - -
b8c07440 by Carl Friedrich Bolz-Tereick at 2021-02-25T13:15:00+01:00
add a random test for finding

--HG--
branch : string-algorithmic-optimizations

- - - - -
36829bf3 by Carl Friedrich Bolz-Tereick at 2021-02-26T11:58:51+01:00
follow what cpython is doing more systematically:

add similar cases, stop using StringBuilder, make a correctly sized llstr
directly. needs a refactoring

--HG--
branch : string-algorithmic-optimizations

- - - - -
888361fd by Carl Friedrich Bolz-Tereick at 2021-02-26T13:40:42+01:00
remove code duplication with rstr by having the real implementation of search
only live in rlib/rstring.py

--HG--
branch : string-algorithmic-optimizations

- - - - -
091c2b01 by Carl Friedrich Bolz-Tereick at 2021-02-26T14:08:44+01:00
maxsplit -> maxcount for replace functions

--HG--
branch : string-algorithmic-optimizations

- - - - -
0dbba608 by Carl Friedrich Bolz-Tereick at 2021-02-26T14:09:59+01:00
fix translation

--HG--
branch : string-algorithmic-optimizations

- - - - -
b63ca915 by Carl Friedrich Bolz-Tereick at 2021-02-26T21:03:03+01:00
remove pdb

--HG--
branch : string-algorithmic-optimizations

- - - - -
528d99e1 by Carl Friedrich Bolz-Tereick at 2021-02-28T14:43:32+01:00
add whatsnew

--HG--
branch : string-algorithmic-optimizations

- - - - -
27181592 by Carl Friedrich Bolz-Tereick at 2021-02-28T14:44:08+01:00
merge string-algorithmic-optimizations

- - - - -


8 changed files:

- pypy/doc/whatsnew-head.rst
- pypy/objspace/std/bytesobject.py
- pypy/objspace/std/test/test_bytesobject.py
- pypy/objspace/std/test/test_unicodeobject.py
- pypy/objspace/std/unicodeobject.py
- rpython/rlib/rstring.py
- rpython/rlib/test/test_rstring.py
- rpython/rtyper/lltypesystem/rstr.py


View it on GitLab: 
https://foss.heptapod.net/pypy/pypy/-/compare/38f81ebcc22a2d98b45b720d48f0d733c57d858d...27181592714453c015cd1239e6be65d4af462b05

-- 
View it on Heptapod: 
https://foss.heptapod.net/pypy/pypy/-/compare/38f81ebcc22a2d98b45b720d48f0d733c57d858d...27181592714453c015cd1239e6be65d4af462b05
You're receiving this email because of your account on foss.heptapod.net.


_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to