diff options
author | Charles-François Natali <neologix@free.fr> | 2013-01-01 16:31:54 +0100 |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2013-01-01 16:31:54 +0100 |
commit | fe22dcaba7c5df856359b364fc3c51e76cc3cc67 (patch) | |
tree | 130997fb728b20ba5f5db71f75d15094473b35c0 | |
parent | ef45380b6b8cae843fa995409f6ba82227ae9659 (diff) | |
download | cpython-git-fe22dcaba7c5df856359b364fc3c51e76cc3cc67.tar.gz |
Issue #16787: Increase asyncore and asynchat default output buffers size, to
decrease CPU usage and increase throughput.
-rw-r--r-- | Lib/asynchat.py | 4 | ||||
-rw-r--r-- | Lib/asyncore.py | 2 | ||||
-rw-r--r-- | Misc/NEWS | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/Lib/asynchat.py b/Lib/asynchat.py index bb636ab7a5..f055d63ba4 100644 --- a/Lib/asynchat.py +++ b/Lib/asynchat.py @@ -56,8 +56,8 @@ class async_chat (asyncore.dispatcher): # 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 index b15ddeb91b..f1466436d1 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -532,7 +532,7 @@ class dispatcher_with_send(dispatcher): 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): @@ -200,7 +200,10 @@ Core and Builtins 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. |