Re: Help (again)

From: George (greerga@CIRCLEMUD.ORG)
Date: 05/02/98


On Fri, 1 May 1998, Mark A. Heilpern wrote:

>At 09:52 PM 4/30/98 -0400, you wrote:
>>C advantage: cleaner interface, easier to understand
>>  disadvantage: slower, doesn't allow transparent snprintf and immediate
>>        detection (and prevention) of overruns.
>>
>>C++, reverse those above.
>
>Are you saying C++ is faster than C in all cases or only in this
>application? (Hopefully you are saying it for some application-
>specific reason, because generally speaking, C++ produces
>larger and slower code, particularly when the nicer features
>such as templates or exception handling are used.)

The C++ version is faster because it passes around a 'Buffer' object.  The
C version has to return a standard 'char *' to be compatible.  Thus, on all
of the release_buffer() calls, the 'char *' has to be looked up in a table.

And I don't use templates or exception handling. (Exception handling is
very bad to use when you have mixed C and C++.)

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST