| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Already backported to release23-maint.
|
| |
|
|
|
|
|
| |
Re-use list object bodies. Saves calls to malloc() and free() for
faster list instantiation and deallocation.
|
| |
|
|
|
|
| |
dynamic embedders of Python.
|
|
|
|
|
| |
a string or unicode object in sre.compile() when a different type
pattern with the same value exists.
|
|
|
|
|
| |
getaddrinfo() properly if the KAME stack had SCTP support.
(Submitted by SUZUKI Shinsuke)
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
close() calls would attempt to free() the buffer already free()ed on
the first close(). [bug introduced with patch #788249]
Making sure that the buffer is free()ed in file object deallocation is
a belt-n-braces bit of insurance against a memory leak.
|
|
|
|
| |
Also, move pystack comment down next to it
|
| |
|
|
|
|
| |
Backported to 2.3.
|
|
|
|
| |
not taken into consideration when caching value.
|
| |
|
| |
|
|
|
|
| |
Added socket.error to the socket module's C API.
|
|
|
|
| |
and one for sort order when using stdout. Uses optparse.
|
| |
|
|
|
|
| |
Fixes SF Bug #773356
|
|
|
|
| |
(Reported by Matthias Klose)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Gives 30% speedup on "a,b=1,2" and 25% on "a,b,c=1,2,3".
|
|
|
|
| |
isinstance() or issubclass() to the recursion limit of the interpreter.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
array.extend() now accepts iterable arguments implements as a series
of appends. Besides being a user convenience and matching the behavior
for lists, this the saves memory and cycles that would be used to
create a temporary array object.
|
|
|
|
|
|
|
|
| |
lists. Speeds append() operations and reduces memory requirements
(because of more conservative overallocation).
Paves the way for the feature request for array.extend() to support
arbitrary iterable arguments.
|
|
|
|
| |
(Contributed by George Yoshida.)
|
|
|
|
| |
Added support for the copy module.
|
|
|
|
|
| |
three recent optimizations. Aside from reducing code volume, it
increases readability.
|
| |
|
|
|
|
|
|
|
| |
The writelines() method now accepts any iterable argument and writes
the lines one at a time rather than using ''.join(lines) followed by
a single write. Results in considerable memory savings and makes the
method suitable for use with generator expressions.
|
|
|
|
|
| |
Add a new opcode, LIST_APPEND, and apply it to the code generation for
list comprehensions. Reduces the per-loop overhead by about a third.
|
|
|
|
|
|
|
|
| |
(Championed by Bob Ippolito.)
The update() method for mappings now accepts all the same argument forms
as the dict() constructor. This includes item lists and/or keyword
arguments.
|
|
|
|
|
| |
* reverse order of files on the command line in pickle2db.py to make it
symmetrical with db2pickle.py in the two-arg case (src, then dest)
|
|
|
|
|
|
|
|
|
|
| |
are within proper boundaries as specified in the docs.
This can break possible code (datetime module needed changing, for instance)
that uses 0 for values that need to be greater 1 or greater (month, day, and
day of year).
Fixes bug #897625.
|
|
|
|
|
| |
and add flag comments to ceval.c and main.c alerting people to the coupling
between pystack and the layout of those files.
|
|
|
|
|
|
|
|
|
|
|
| |
recent gcc on Linux/x86)
[ 899109 ] 1==float('nan')
by implementing rich comparisons for floats.
Seems to make comparisons involving NaNs somewhat less surprising
when the underlying C compiler actually implements C99 semantics.
|
|
|
|
|
| |
/usr/bin/env python'%{binsuffix}
Backported to 2.3.
|
|
|
|
| |
Backported to 2.3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to list_init.
* Replaced the code in list_extend with the superior code from list_fill.
* Eliminated list_fill.
Results:
* list.extend() no longer creates an intermediate tuple except to handle
the special case of x.extend(x). The saves memory and time.
* list.extend(x) runs
about the same x is a list or tuple,
a little faster when x is an iterable not defining __len__, and
twice as fast when x is an iterable defining __len__.
* the code is about 15 lines shorter and no longer duplicates
functionality.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Py2.3 approach overallocated small lists by up to 8 elements.
The last checkin would limited this to one but slowed down (by 20 to 30%)
the creation of small lists between 3 to 8 elements.
This tune-up balances the two, limiting overallocation to 3 elements
(significantly reducing space consumption from Py2.3) and running faster
than the previous checkin.
The first part of the growth pattern (0, 4, 8, 16) neatly meshes with
allocators that trigger data movement only when crossing a power of two
boundary. Also, then even numbers mesh well with common data alignments.
|
|
|
|
| |
as parameter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
realloc(). This is achieved by tracking the overallocation size in a new
field and using that information to skip calls to realloc() whenever
possible.
* Simplified and tightened the amount of overallocation. For larger lists,
this overallocates by 1/8th (compared to the previous scheme which ranged
between 1/4th to 1/32nd over-allocation). For smaller lists (n<6), the
maximum overallocation is one byte (formerly it could be upto eight bytes).
This saves memory in applications with large numbers of small lists.
* Eliminated the NRESIZE macro in favor of a new, static list_resize function
that encapsulates the resizing logic. Coverting this back to macro would
give a small (under 1%) speed-up. This was too small to warrant the loss
of readability, maintainability, and de-coupling.
* Some functions using NRESIZE had grown unnecessarily complex in their
efforts to bend to the macro's calling pattern. With the new list_resize
function in place, those other functions could be simplified. That is
being saved for a separate patch.
* The ob_item==NULL check could be eliminated from the new list_resize
function. This would entail finding each piece of code that sets ob_item
to NULL and adding a new line to invalidate the overallocation tracking
field. Rather than impose a new requirement on other pieces of list code,
it was preferred to leave the NULL check in place and retain the benefits
of decoupling, maintainability and information hiding (only PyList_New()
and list_sort() need to know about the new field). This approach also
reduces the odds of breaking an extension module.
(Collaborative effort by Raymond Hettinger, Hye-Shik Chang, Tim Peters,
and Armin Rigo.)
|