help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ / multiple instances / iostreams


From: Hans Aberg
Subject: Re: C++ / multiple instances / iostreams
Date: Thu, 22 Jul 2004 00:07:26 +0200

At 22:58 +0200 2004/07/21, Laurence Finston wrote:
>> ... C++ is a multiparadigm language. But the high level cannot be as
>> efficient as optimized low-level programming.
>
>I just read a relevant passage in _The C++ Programming Language_ the other
>day, but unfortunately I don't have it here, so I can't quote it at you.  In
>both that book and _The Design and Evolution_ Stroustrup is very firm that C++
>should be as efficient as C when only the common subset of C and C++ is used.
>He argues, persuasively I think, for all of the features in C++ that are not
>in C, and for the features provided by the standard library, that  the
>cost/benefit ratio is always reasonable.

Right. (We risk to get off-topic now.)

>   Of course, an implementation may be
>particulary efficient or inefficient.
>
>>From my point of view,  in the case of an inefficient implementation of, say,
>a standard library template class, my solution would be use it anyway, and
>hope that the implementors of `libstdc++' improve it, as I'm confident they
>will do.  After all, my package isn't used for anything people's lives depend
>on.

Modern C++ compilers are not so inefficient.

>On the other hand, if I thought that C++ was significantly less efficient than
>C, I would have used C.   "Optimized" to me means optimized for a particular
>machine.   I'm not sure I'll ever get around to doing this, but I am curious
>whether implementing matrix multiplication and inversion in assembler would
>produce a performance benefit.

The GNU library GMP uses assembler for arithmetic in order speed it up on
particular machines.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]