| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | | |
characters when used with the "replace" error handler on invalid utf-8 sequences. Patch by Serhiy Storchaka, tests by Ezio Melotti.
|
| | |
| | |
| | |
| | |
| | |
| | | |
is empty.
Patch by Serhiy Storchaka.
|
| | |
| | |
| | |
| | | |
endianess detection and handling.
|
|/ / |
|
| |
| |
| |
| |
| |
| | |
integer values, by using Py_uintptr_t instead of size_t.
Patch by Serhiy Storchaka.
|
| |
| |
| |
| |
| |
| | |
(_s => s)
Replace _s with ptr to avoid future confusion. Add also non regression tests.
|
| | |
|
| |
| |
| |
| | |
Serhiy Storchaka.
|
| | |
|
| |
| |
| |
| | |
Patch by Serhiy Storchaka.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
and str.format(args)
* Formatting string, int, float and complex use the _PyUnicodeWriter API. It
avoids a temporary buffer in most cases.
* Add _PyUnicodeWriter_WriteStr() to restore the PyAccu optimization: just
keep a reference to the string if the output is only composed of one string
* Disable overallocation when formatting the last argument of str%args and
str.format(args)
* Overallocation allocates at least 100 characters: add min_length attribute
to the _PyUnicodeWriter structure
* Add new private functions: _PyUnicode_FastCopyCharacters(),
_PyUnicode_FastFill() and _PyUnicode_FromASCII()
The speed up is around 20% in average.
|
| |
| |
| |
| | |
Patch by Serhiy Storchaka.
|
| |
| |
| |
| | |
Storchaka.
|
| | |
|
| |
| |
| |
| |
| | |
Optimize also PyUnicode_Format(): call unicode_writer_prepare() only once
per argument.
|
| |
| |
| |
| | |
PyAccu API. For example, it makes str.format() from 25% to 30% faster on Linux.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Decode thousands separator and decimal point using PyUnicode_DecodeLocale()
(from the locale encoding), instead of decoding them implicitly from latin1
* Remove _PyUnicode_InsertThousandsGroupingLocale(), it was not used
* Change _PyUnicode_InsertThousandsGrouping() API to return the maximum
character if unicode is NULL
* Replace MIN/MAX macros by Py_MIN/Py_MAX
* stringlib/undef.h undefines STRINGLIB_IS_UNICODE
* stringlib/localeutil.h only supports Unicode
|
| | |
|
| |
| |
| |
| | |
The main bottleneck was the PyUnicode_READ() macro.
|
| |
| |
| |
| |
| | |
bytes.find() and handle correctly OverflowError (raise the same ValueError than
the error for -1).
|
| |
| |
| |
| | |
Create an empty string with the new Unicode API.
|
| |
| |
| |
| |
| | |
This almost catches up with pre-PEP 393 performance, when decoding needed
only one pass.
|
| | |
|
| |
| |
| |
| |
| | |
* _PyUnicode_CheckConsistency() now takes a PyObject* instead of void*
* Remove now useless casts to PyObject*
|
| |
| |
| |
| |
| |
| | |
A Unicode string can now be a PyASCIIObject, PyCompactUnicodeObject or
PyUnicodeObject. Aliasing a PyASCIIObject* or PyCompactUnicodeObject* to
PyUnicodeObject* is wrong
|
| |
| |
| |
| |
| | |
of bytes and bytearray objects now accept an integer between 0 and 255
as their first argument. Patch by Petri Lehtinen.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
* If needle is 0, try (p[0] >> 16) & 0xff for UCS4
* Disable fastsearch_memchr_1char() if needle is zero for UCS2 and UCS4
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Example:
./python -m timeit -s "f='{}' + '-' * 1024 + '{}'; s='abcd' * 16384" "f.format(s, s)"
-> before: 547 usec per loop
-> after: 13 usec per loop
-> 3.2: 22.5 usec per loop
-> 2.7: 12.6 usec per loop
|
| | |
|
| |
| |
| |
| |
| |
| | |
ucs1, ucs2 and ucs4 libraries have to scan created substring to find the
maximum character, whereas it is not need to ASCII strings. Because ASCII
strings are common, it is useful to optimize ASCII.
|
| | |
|
| | |
|
| |
| |
| |
| | |
hashes, array and list iterations, and get_integer (stringlib/string_format.h)
|
|/
|
|
| |
(stringlib/formatter.h)
|
|
|
|
| |
ValueError instead of SystemError.
|
|\
| |
| |
| | |
Torsten Becker. (closes #11828)
|
| |
| |
| |
| | |
Becker. (closes #11828)
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83400 | mark.dickinson | 2010-08-01 11:41:49 +0100 (Sun, 01 Aug 2010) | 7 lines
Issue #9416: Fix some issues with complex formatting where the
output with no type specifier failed to match the str output:
- format(complex(-0.0, 2.0), '-') omitted the real part from the output,
- format(complex(0.0, 2.0), '-') included a sign and parentheses.
........
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r81823 | benjamin.peterson | 2010-06-07 17:31:26 -0500 (Mon, 07 Jun 2010) | 9 lines
Merged revisions 81820 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81820 | benjamin.peterson | 2010-06-07 17:23:23 -0500 (Mon, 07 Jun 2010) | 1 line
correctly overflow when indexes are too large
........
................
r81835 | benjamin.peterson | 2010-06-08 09:57:22 -0500 (Tue, 08 Jun 2010) | 9 lines
Merged revisions 81834 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81834 | benjamin.peterson | 2010-06-08 09:53:29 -0500 (Tue, 08 Jun 2010) | 1 line
kill extra word
........
................
|