This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients christian.heimes, sbt, serhiy.storchaka, socketpair
Date 2013-07-04.10:37:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1372934225.62.0.822825151921.issue18329@psf.upfronthosting.co.za>
In-reply-to
Content
I first suspected that file based IO involves too many syscalls and context switches. However ``strace -c`` showed only minor differences in the amount of syscalls. The difference between read() and recvfrom() should not make any difference.

perf revealed that the makefile() test uses much more CPU cycles. A quick check with python3.3 -m profile points to Python method call overhead. Five methods are called more than 122,000 times each and a couple of attributes are checked, too. Perhaps we can optimize away _checkReadable() and _checkClosed()?

I think I know what's going on here. For socket IO readline() uses a readahead buffer size of 1. For each char a cascade of Python functions is called. os.fdopen() uses a default buffering of 4096 (or more) so it's not affected.
History
Date User Action Args
2013-07-04 10:37:05christian.heimessetrecipients: + christian.heimes, socketpair, sbt, serhiy.storchaka
2013-07-04 10:37:05christian.heimessetmessageid: <1372934225.62.0.822825151921.issue18329@psf.upfronthosting.co.za>
2013-07-04 10:37:05christian.heimeslinkissue18329 messages
2013-07-04 10:37:05christian.heimescreate