A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-April/014167.html below:

[Python-Dev] Import hook to do end-of-line conversion?

[Pythonmac-SIG] Re: [Python-Dev] Import hook to do end-of-line conversion? [Pythonmac-SIG] Re: [Python-Dev] Import hook to do end-of-line conversion?Guido van Rossum guido@digicool.com
Thu, 12 Apr 2001 17:37:09 -0500
> I don't get it: why would a thin layer on top of stdio be bad? Seems
> much less work than reimplementing stdio.

Because by layering stuff you lose performance.  Example: fgets() is
often implemented in a way that is faster than you can ever do
yourself with portable code.  (Because fgets() can peek in the buffer
and see if there's a \n somewhere ahead, using memcmp() -- and if this
succeeds, it can use memcpy().  You can't do that yourself - only the
stdio implementation can.  And this is not a hypothetical situation --
Tim used fgets() for a significant speed-up of readline() in 2.1.

But if we want to use our own line end convention, we can't use
fgets() any more, so we lose big.

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4