Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Reexamining Python 3 Text I/O. Python 3.1’s IO performance is a huge improvement over 3.0, but still considerably slower than 2.6. It turns out it’s all to do with Python 3’s unicode support: When you read a file in to a string, you’re asking Python to decode the bytes in to UTF-8 (the new default encoding) at the same time. If you open the file in binary mode Python 3 will read raw bytes in to a bytestring instead, avoiding the conversion overhead and performing only 4% slower than the equivalent code in Python 2.6.4.

Tagged , , , , , ,

8 comments

  1. This is a huge improvement and I don't think that is slower than 2.6. aer conditionat

    Daniel - 7th September 2011 14:33 - #

  2. I will keep visiting this blog very often. It is good to see you verbalize from the heart and your clarity on this important subject can be easily observed. mediahuset nova svindel

    danish - 5th October 2011 12:01 - #

  3. I will recommend my friends to read this. Bottes UGGI am quite sure they will UGG Pas Cher learn lots of new stuff here than anybody else!

    ugg pas cher - 29th October 2011 03:05 - #

  4. I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else! Best Whole House Water Filters

    Groundless - 1st November 2011 06:45 - #

  5. Your design looks very much appealing. It's so simple yet it looks trendy. cuu du lieu

    ken - 3rd November 2011 06:48 - #

  6. This is the exact way that people expecting we can see most of the comments are true and towards the positive opinion..This is the exact way that people expecting we can see most of the comments are true and towards the positive opinion..bao ve

    kentas - 3rd November 2011 06:49 - #

  7. It is good to see you verbalize from the heart and your clarity on this important subject can be easily observed. ke sieu thi

    sa - 3rd November 2011 06:51 - #

  8. I admire the valuable information you offer in your articles quay ke

    sa - 3rd November 2011 06:53 - #

Comments are closed.
A django site