TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JERRY COFFIN
from: DARIN MCBRIDE
date: 1997-07-29 20:16:00
subject: template hell?

 -=> Quoting Jerry Coffin to Darin Mcbride
 KC> Well I've already got a huge linked-list class (bi-directional,
 KC> start/end optimisation, the works). Only problem with moving the
 KC> the STL would be the lack of any source code (at least on my
 KC> version). As
 
 DM> Minor details.  ;-)
 JC> I'm hard put to agree that lack of source code is a minor detail.
Jerry, notice the smiley.
 JC> However, I'm interested in knowing exactly how they're distributing
 JC> STL without source code.  Nearly all versions I've seen are distributed
Also notice the conversation.  KC mentioned "on my version."  i.e., his
compiler does not currently have the STL.
 DM> The STL classes are generally within 2-5% of the speed of hand-coded
 DM> C/C++ (non-templated) libraries.
 JC> Not in my experience.  This obviously depends somewhat upon the
 JC> specific implementation of STL you work with, as somebody can write an
 JC> arbitrarily poor implementation.  However, my own experience has been
 JC> that the variation has been much wider than the numbers above suggest.
 JC> Some of this depends on exactly what you compare though.  For
I'm using HP's numbers... which could be a bit biased... ;-)
 JC> instance, STL uses one ownership policy, which can involve creating and
 JC> destroying quite a few objects.  Many situations don't really require
 JC> that, and can gain _considerable_ speed by avoiding it.  (I've got one
 JC> that more than tripled in speed when STL was replaced with more
 JC> specialized code.
Have you tried using reference-counting pointers as your contained type?
 JC> However, STL is nearly always good enough to at least use for the
 JC> prototype, and is only worth replacing when you find that it's a cause
 JC> of a major bottleneck.  This was the case with the code mentioned
 JC> above, but certainly is NOT the case in LOTS of other code I've dealt
 JC> with. Later,
And, of course, when you just _have_ to have it work, regardless of speed,
and have little time to play with, it's useful.  :-)  Not all implementations
require speed at runtime, just in development.
... Sure I'm full of myself. If I wasn't who would I be full of?
--- FastEcho 1.46
---------------
* Origin: House of Fire BBS - Toronto - (416)601-0085 - v.34 (1:250/536)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.