[New-bugs-announce] [issue6117] Fix O(n**2) performance problem in socket._fileobject

Kristján Valur Jónsson report at bugs.python.org
Tue May 26 18:03:59 CEST 2009

New submission from Kristján Valur Jónsson <kristjan at ccpgames.com>:

the socket._fileobject._wbuf is a list of strings to output.  This patch 
keeps the length of this buffer as a separate member variable, rather than  
computing it dynamically, which sums to a O(n**2) operation as the buffer 
is filled up.  Significant performance degradation was observed when 
outputting lots of small data to a buffered socket using the old method.

files: socket.patch
keywords: easy, needs review, patch, patch
messages: 88366
nosy: krisvale
severity: normal
status: open
title: Fix O(n**2) performance problem in socket._fileobject
type: performance
versions: Python 2.7
Added file: http://bugs.python.org/file14080/socket.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list