Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Whitespace normalization | Neal Norwitz | 2006-07-30 | 1 | -35/+32 |
| | |||||
* | Bug #1515471: string.replace() accepts character buffers again. | Neal Norwitz | 2006-07-30 | 1 | -71/+51 |
| | | | | Pass the char* and size around rather than PyObject's. | ||||
* | Update doc to make it agree with code. | Neal Norwitz | 2006-06-11 | 1 | -10/+4 |
| | | | | Bottom factor out some common code. | ||||
* | Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError. | Georg Brandl | 2006-06-10 | 1 | -1/+1 |
| | | | | Also improve error message on overflow. | ||||
* | RFE #1491485: str/unicode.endswith()/startswith() now accept a tuple as ↵ | Georg Brandl | 2006-06-09 | 1 | -60/+90 |
| | | | | first argument. | ||||
* | Remove ; at end of macro. There was a compiler recently that warned | Neal Norwitz | 2006-06-01 | 1 | -1/+1 |
| | | | | | about extra semi-colons. It may have been the HP C compiler. This file will trigger a bunch of those warnings now. | ||||
* | needforspeed: added Py_MEMCPY macro (currently tuned for Visual C only), | Fredrik Lundh | 2006-05-28 | 1 | -37/+37 |
| | | | | | and use it for string copy operations. this gives a 20% speedup on some string benchmarks. | ||||
* | needforspeed: stringlib refactoring: use find_slice for stringobject | Fredrik Lundh | 2006-05-27 | 1 | -12/+15 |
| | |||||
* | needforspeed: replace improvements, changed to Py_LOCAL_INLINE | Fredrik Lundh | 2006-05-27 | 1 | -16/+16 |
| | | | | where appropriate | ||||
* | cleanup - removed trailing whitespace | Andrew Dalke | 2006-05-27 | 1 | -1/+1 |
| | |||||
* | needforspeed: more stringlib refactoring | Fredrik Lundh | 2006-05-27 | 1 | -55/+39 |
| | |||||
* | Added description of why splitlines doesn't use the prealloc strategy | Andrew Dalke | 2006-05-26 | 1 | -0/+8 |
| | |||||
* | Added limits to the replace code so it does not count all of the matching | Andrew Dalke | 2006-05-26 | 1 | -22/+19 |
| | | | | patterns in a string, only the number needed by the max limit. | ||||
* | needforspeed: stringlib refactoring: use stringlib/find for string find | Fredrik Lundh | 2006-05-26 | 1 | -19/+6 |
| | |||||
* | needforspeed: stringlib refactoring, continued. added count and | Fredrik Lundh | 2006-05-26 | 1 | -2/+2 |
| | | | | find helpers; updated unicodeobject to use stringlib_count | ||||
* | substring split now uses /F's fast string matching algorithm. | Andrew Dalke | 2006-05-26 | 1 | -40/+57 |
| | | | | | | | | | | (If compiled without FAST search support, changed the pre-memcmp test to check the last character as well as the first. This gave a 25% speedup for my test case.) Rewrote the split algorithms so they stop when maxsplit gets to 0. Previously they did a string match first then checked if the maxsplit was reached. The new way prevents a needless string search. | ||||
* | needforspeed: added rpartition implementation | Fredrik Lundh | 2006-05-26 | 1 | -0/+36 |
| | |||||
* | needforspeed: remove remaining USE_FAST macros; if fastsearch was | Fredrik Lundh | 2006-05-26 | 1 | -67/+2 |
| | | | | broken, someone would have noticed by now ;-) | ||||
* | needforspeed: cleanup | Fredrik Lundh | 2006-05-26 | 1 | -4/+8 |
| | |||||
* | needforspeed: stringlib refactoring (in progress) | Fredrik Lundh | 2006-05-26 | 1 | -34/+5 |
| | |||||
* | needforspeed: stringlib refactoring (in progress) | Fredrik Lundh | 2006-05-26 | 1 | -92/+7 |
| | |||||
* | needforspeed: use Py_LOCAL on a few more locals in stringobject.c | Fredrik Lundh | 2006-05-26 | 1 | -26/+27 |
| | |||||
* | Eeked out another 3% or so performance in split whitespace by cleaning up ↵ | Andrew Dalke | 2006-05-26 | 1 | -35/+38 |
| | | | | the algorithm. | ||||
* | Changes to string.split/rsplit on whitespace to preallocate space in the | Andrew Dalke | 2006-05-26 | 1 | -56/+75 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | results list. Originally it allocated 0 items and used the list growth during append. Now it preallocates 12 items so the first few appends don't need list reallocs. ("Here are some words ."*2).split(None, 1) is 7% faster ("Here are some words ."*2).split() is is 15% faster (Your milage may vary, see dealership for details.) File parsing like this for line in f: count += len(line.split()) is also about 15% faster. There is a slowdown of about 3% for large strings because of the additional overhead of checking if the append is to a preallocated region of the list or not. This will be the rare case. It could be improved with special case code but we decided it was not useful enough. There is a cost of 12*sizeof(PyObject *) bytes per list. For the normal case of file parsing this is not a problem because of the lists have a short lifetime. We have not come up with cases where this is a problem in real life. I chose 12 because human text averages about 11 words per line in books, one of my data sets averages 6.2 words with a final peak at 11 words per line, and I work with a tab delimited data set with 8 tabs per line (or 9 words per line). 12 encompasses all of these. Also changed the last rstrip code to append then reverse, rather than doing insert(0). The strip() and rstrip() times are now comparable. | ||||
* | use Py_LOCAL also for string and unicode objects | Fredrik Lundh | 2006-05-26 | 1 | -13/+1 |
| | |||||
* | needforspeed: use Py_ssize_t for the fastsearch counter and skip | Fredrik Lundh | 2006-05-26 | 1 | -1/+1 |
| | | | | | length (thanks, neal!). and yes, I've verified that this doesn't slow things down ;-) | ||||
* | needforspeed: use METH_O for argument handling, which made partition some | Fredrik Lundh | 2006-05-26 | 1 | -6/+2 |
| | | | | | ~15% faster for the current tests (which is noticable faster than a corre- sponding find call). thanks to neal-who-never-sleeps for the tip. | ||||
* | needforspeed: partition implementation, part two. | Fredrik Lundh | 2006-05-26 | 1 | -15/+15 |
| | | | | feel free to improve the documentation and the docstrings. | ||||
* | needforspeed: partition for 8-bit strings. for some simple tests, | Fredrik Lundh | 2006-05-25 | 1 | -5/+66 |
| | | | | | | | | this is on par with a corresponding find, and nearly twice as fast as split(sep, 1) full tests, a unicode version, and documentation will follow to- morrow. | ||||
* | squelch gcc4 darwin/x86 compiler warnings | Bob Ippolito | 2006-05-25 | 1 | -1/+1 |
| | |||||
* | needforspeed: use insert+reverse instead of append | Fredrik Lundh | 2006-05-25 | 1 | -16/+8 |
| | |||||
* | * eliminate warning by reverting tmp_s type to 'const char*' | Jack Diederich | 2006-05-25 | 1 | -1/+1 |
| | |||||
* | needforspeed: use fastsearch also for find/index and contains. the | Fredrik Lundh | 2006-05-25 | 1 | -1/+25 |
| | | | | related tests are now about 10x faster. | ||||
* | Added overflow test for adding two (very) large strings where the | Andrew Dalke | 2006-05-25 | 1 | -2/+7 |
| | | | | | new string is over max Py_ssize_t. I have no way to test it on my box or any box I have access to. At least it doesn't break anything. | ||||
* | Comment typo | Andrew M. Kuchling | 2006-05-25 | 1 | -1/+1 |
| | |||||
* | needforspeed: use "fastsearch" for count. this results in a 3x speedup | Fredrik Lundh | 2006-05-25 | 1 | -1/+122 |
| | | | | for the related stringbench tests. | ||||
* | Fixed problem identified by Georg. The special-case in-place code for replace | Andrew Dalke | 2006-05-25 | 1 | -2/+5 |
| | | | | | | | | | | | made a copy of the string using PyString_FromStringAndSize(s, n) and modify the copied string in-place. However, 1 (and 0) character strings are shared from a cache. This cause "A".replace("A", "a") to change the cached version of "A" -- used by everyone. Now may the copy with NULL as the string and do the memcpy manually. I've added regression tests to check if this happens in the future. Perhaps there should be a PyString_Copy for this case? | ||||
* | needforspeed: new replace implementation by Andrew Dalke. replace is | Fredrik Lundh | 2006-05-25 | 1 | -182/+605 |
| | | | | | now about 3x faster on my machine, for the replace tests from string- bench. | ||||
* | needforspeed: check for overflow in replace (from Andrew Dalke) | Fredrik Lundh | 2006-05-25 | 1 | -2/+21 |
| | |||||
* | needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C | Fredrik Lundh | 2006-05-25 | 1 | -0/+9 |
| | | | | versions if they're not defined. | ||||
* | needforspeed: make new upper/lower work properly for single-character | Fredrik Lundh | 2006-05-25 | 1 | -4/+8 |
| | | | | | strings too... (thanks to georg brandl for spotting the exact problem faster than anyone else) | ||||
* | needforspeed: speed up upper and lower for 8-bit string objects. | Fredrik Lundh | 2006-05-25 | 1 | -22/+20 |
| | | | | | | | (the unicode versions of these are still 2x faster on windows, though...) based on work by Andrew Dalke, with tweaks by yours truly. | ||||
* | docstring tweaks: count counts non-overlapping substrings, not | Fredrik Lundh | 2006-05-22 | 1 | -3/+3 |
| | | | | total number of occurences | ||||
* | Teach PyString_FromFormat, PyErr_Format, and PyString_FromFormatV | Tim Peters | 2006-05-13 | 1 | -13/+22 |
| | | | | | | | | | | | | about "%u", "%lu" and "%zu" formats. Since PyString_FromFormat and PyErr_Format have exactly the same rules (both inherited from PyString_FromFormatV), it would be good if someone with more LaTeX Fu changed one of them to just point to the other. Their docs were way out of synch before this patch, and I just did a mass copy+paste to repair that. Not a backport candidate (this is a new feature). | ||||
* | Revert 43315: Printing of %zd must be signed. | Martin v. Löwis | 2006-05-13 | 1 | -2/+2 |
| | |||||
* | Py_ssize_t issue; repr()'ing a very large string would result in a teensy | Thomas Wouters | 2006-04-21 | 1 | -1/+1 |
| | | | | string, because of a cast to int. | ||||
* | Make s.replace() work with explicit counts exceeding 2Gb. | Thomas Wouters | 2006-04-19 | 1 | -2/+2 |
| | |||||
* | Use Py_ssize_t to hold the 'width' argument to the ljust, rjust, center and | Thomas Wouters | 2006-04-19 | 1 | -8/+8 |
| | | | | | | zfill stringmethods, so they can create strings larger than 2Gb on 64bit systems (even win64.) The unicode versions of these methods already did this right. | ||||
* | C++ compiler cleanup: bunch-o-casts, plus use of unsigned loop index var in ↵ | Skip Montanaro | 2006-04-18 | 1 | -1/+1 |
| | | | | a couple places | ||||
* | No need to cast a Py_ssize_t, use %z in PyErr_Format | Neal Norwitz | 2006-04-17 | 1 | -2/+2 |
| |