VC71 and STL performance

VC71 and STL performance

Post by sharadhona » Mon, 21 Jun 2004 15:36:43


In vc6.0 and before, I have always used STLport's stl due because
everyone else was and due to the availability of hash_map etc. Now I
am having trouble porting STLport 4.6.2 to vc7 and the later beta
version forces to use the STLport build of the iostream libraries.

Could anyone tell me their experience withe Microsoft's STL that comes
with vc71. Issues concerning performance, statndards conformance etc.

Thanks
 
 
 

VC71 and STL performance

Post by Carl Danie » Tue, 22 Jun 2004 02:31:22


Performance: I've never had a problem, but there are performance
differences. The one that came up recently is that std::vector::clear()
forces the vector to reallocate on the next insert rather than setting the
size to 0 and keeping the existing allocation. That can be of significance
in some use cases. The workaround is to use vector.erase(begin(),end())
instead of clear(), or to modify <vector> to do that. In the forthcoming
VC8 vector::clear() is precicely erase(begin(),end()).

Conformace: Much better than STLport.

-cd

 
 
 

VC71 and STL performance

Post by tom_usene » Tue, 22 Jun 2004 19:19:24

On 19 Jun 2004 23:36:43 -0700, XXXX@XXXXX.COM (Sharad)



In addition to what Carl said, there are a few more performance
issues:

std::string uses the small string optimization, no reference counting
and exponential growth (I think). This means performance
characteristics are different from MSVC6's lib and STLport.

Dinkumware's IOStreams is still, I suspect, slower than STLport's. On
the other hand, it is conforming, and STLport isn't.

Tom
--
C++ FAQ: http://www.yqcomputer.com/ ++-faq-lite/
C FAQ: http://www.yqcomputer.com/ ~scs/C-faq/top.html
 
 
 

VC71 and STL performance

Post by sharadhona » Tue, 22 Jun 2004 23:36:50

Thanks a lot guys

Sharad