gregory p smith amuhkryptoorg mon apr 14 2008 441 pm curt hagenlocher wrote mon apr 14 2008 419 pm guido van rossum wrote imaplib apparently specifying 10mb know much data want bother looping data smaller buffer increments eg 64k probably max tcp stacks give im going guess code question size intselfmogroupsize __debug__ selfdebug 4 self_mesgread literal size size data selfreadsize reading however many bytes reported server size im right hunch tcp stack probably clamp 64k perhaps use minsystem limit maxrequested size buffer size indeed missed point read buffer size would work 64k hunch wrong system limit found using getsockoptso_rcvbuf easily often set many megabytes either system default level per socket level user using setsockopt system default large limiting system limit would help 10mb read case even smaller allocations like 64k cause problems mentioned issue 1092502 linking twisted httptwistedmatrixcomtracticket1079bug twisteds solution make string object returned recv short lived possible copying stringio could _fileobjectread readline attached patch issue 2632 changes socket use stringio read buffer keeps lifetime strings returned recv short possible appropriate also refuses call recv size smaller default_bufsize within read source performance problem changes internal recv call behavior existing code issue 1092502 fix applied use min rather max significant change pre1092502 fix behavior exists released versions python already chose larger two values recv sizes main difference behind scenes stringio using realloc increase size recv using realloc shrink allocation size many recved shrunken strings held onto list final value constructed suggest continuing discussion within issue 2632 keep better track socketstrio patch 2632 needs testing passed socket http url tests verification issues problems indeed gone gps thu 07 aug 2008 144444 0700 pythondev bad network performance