[RANT] STL complaints (was Languages)

From: Chris Jacobson (fear@technologist.com)
Date: 03/10/99

Well, I recently was rereading the Standard Template Library section of
Bjarne Stroustrup's "The C++ Programming Language, 3rd Edition" (highly
recommended).  I began to like the STL, so began a quest to convert
LexiMUD to STL (considering my existing LList, Map, and Vector classes
depreciated in comparison).

It went quite well actually at first, but when I got into some real
compiling, that is when I noticed the problems:

1. STL requires a LOT of header overhead - ~100,000 lines extra (!).
   In compiling affects.c++, a 422 line file, normally, has a total
   of ~15,000 lines.  With STL it reached > 110,000.  Thus compile
   time was much longer, by a factor of 2-5 depending on the file.
2. Binary sized increased by 100%
   affects.c++ is normally 4k code, 1k data.  With STL it reached
   7.5k code, 2.5k data.
3. A redesign of some parts of code (such as Affects) would be necessary
   to accomodate STL.

Points 1 and 2 applied to every file I worked with.  After finally
converting characters.c++ and several other files to the new STL'd
LexiMUD, I finally got sick of the compile times and other overhead,
stuffed (equiv to tgz) up the archives, and restored from an hour
earlier, pre-STLizing.  I was using MetroWerk's STL (they use a version
of the Modina STL)

In talking with a friend of mine - "Gabe" (one of the coders for Graphic
Simulations' Hornet and Hornet: Korea) - he mentioned that his group had
similiar experiences with SGI STL, and performance was usually half that
of privately written template classes.  While performance isn't a concern
for me, the compile times and binary sizes are.

Thus it is with a resigned sigh that I returned to my earlier version of
LexiMUD using my own classes (and later last night rewrote Map<> to use
an AVL tree <g>).

- Chris Jacobson

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

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