]> granicus.if.org Git - python/commitdiff
Issue #16787: Increase asyncore and asynchat default output buffers size, to
authorCharles-François Natali <neologix@free.fr>
Tue, 1 Jan 2013 15:31:54 +0000 (16:31 +0100)
committerCharles-François Natali <neologix@free.fr>
Tue, 1 Jan 2013 15:31:54 +0000 (16:31 +0100)
decrease CPU usage and increase throughput.

Lib/asynchat.py
Lib/asyncore.py
Misc/NEWS

index bb636ab7a5d0e5175c57904a5d420041852e8a27..f055d63ba49a3a3d933e82eb93bcf442f8953da3 100644 (file)
@@ -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
index b15ddeb91b0f65c71f24942cf6eb2f8754fcba54..f1466436d1bc7572a4aa2ee3f689e6d35fe2e656 100644 (file)
@@ -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):
index 88a73e47905b8d55ad90ba524d825c2e3350cbb1..ccbf416e3a4e2cbc3b3914bf24e6cc04f93bb274 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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.