[Python-Dev] Deprecate codecs.open() and StreamWriter/StreamReader (original) (raw)
Victor Stinner victor.stinner at haypocalc.com
Wed May 25 18:04:17 CEST 2011
- Previous message: [Python-Dev] Deprecate codecs.open() and StreamWriter/StreamReader
- Next message: [Python-Dev] Deprecate codecs.open() and StreamWriter/StreamReader
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le mercredi 25 mai 2011 à 13:10 +0200, Victor Stinner a écrit :
codecs is always faster (between 1.07 and 1.15 times faster than io) to read the whole content of file using read(-1). Something should maybe be optimized in TextIOWrapper.read() ;-)
Oh, I understood: it's maybe the universal newline mode of TextIOWrapper was enabled. If you disable is using open(..., newline='\n'), io and codecs run at the same speed to read the whole content of the file (f.read()).
Victor
- Previous message: [Python-Dev] Deprecate codecs.open() and StreamWriter/StreamReader
- Next message: [Python-Dev] Deprecate codecs.open() and StreamWriter/StreamReader
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]