Is Python overhyped (just like Java)?
David Abrahams
dave at boost-consulting.com
Mon Mar 31 19:31:58 EST 2003
"Delaney, Timothy C (Timothy)" <tdelaney at avaya.com> writes:
>> From: David Abrahams [mailto:dave at boost-consulting.com]
>>
>> Also, it's only fair to point out that C++ doesn't have one library
>> implementation -- each compiler comes with its own. Which
>> implementation(s) were you testing? Oh, I see it was probably
>> libstdc++ that comes with gcc 3.1. Well, IIRC GCC-3.1 was well
>> known to optimize poorly (it took them some time to figure out how
>> to integrate all the new optimizations that came in with GCC-3, and
>> they actually made things slower for a while), and I wouldn't
>> exactly say that libstdc++ is the fastest implementation.
>
> I think if you'll read the above, you will notice that Alex says
> exactly the same thing "...with different implementations, you may see
> different ratios."
Quite right; I do see that.
> Also, "read all the lines from a file" is not a primitive in Python -
> it's a method call ... *and* it is written in C.
That's what I mean by "a primitive". All of Python is written in C,
so that's as primitive as things get. "Read all the lines from a
file" can be specifically optimized for Python, whereas when you write
the "obvious" code for it in C++, you're probably seeing overheads
which reflect, e.g., buffering which makes sense for general-purpose
I/O but which is a waste when reading all lines from a file.
> Obviously there could be as good an implementation in C++ on the
> same platform - whether there could be a *better* implementation is
> another question.
And another question is whether there could be a better
implementation *for that particular job*.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Python-list
mailing list