[Python-checkins] cpython: Issue #16787: Increase asyncore and asynchat default output buffers size, to
charles-francois.natali
python-checkins at python.org
Tue Jan 1 16:33:36 CET 2013
http://hg.python.org/cpython/rev/2eddf7c2efe6
changeset: 81188:2eddf7c2efe6
user: Charles-François Natali <neologix at free.fr>
date: Tue Jan 01 16:31:54 2013 +0100
summary:
Issue #16787: Increase asyncore and asynchat default output buffers size, to
decrease CPU usage and increase throughput.
files:
Lib/asynchat.py | 4 ++--
Lib/asyncore.py | 2 +-
Misc/NEWS | 5 ++++-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/Lib/asynchat.py b/Lib/asynchat.py
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -56,8 +56,8 @@
# these are overridable defaults
- ac_in_buffer_size = 4096
- ac_out_buffer_size = 4096
+ ac_in_buffer_size = 65536
+ ac_out_buffer_size = 65536
# we don't want to enable the use of encoding by default, because that is a
# sign of an application bug that we don't want to pass silently
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -532,7 +532,7 @@
def initiate_send(self):
num_sent = 0
- num_sent = dispatcher.send(self, self.out_buffer[:512])
+ num_sent = dispatcher.send(self, self.out_buffer[:65536])
self.out_buffer = self.out_buffer[num_sent:]
def handle_write(self):
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -200,7 +200,10 @@
Library
-------
-- Issue 10527: make multiprocessing use poll() instead of select() if available.
+- Issue #16787: Increase asyncore and asynchat default output buffers size, to
+ decrease CPU usage and increase throughput.
+
+- Issue #10527: make multiprocessing use poll() instead of select() if available.
- Issue #16688: Fix backreferences did make case-insensitive regex fail on
non-ASCII strings. Patch by Matthew Barnett.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list