stdlib streams are slower than gcc or KAI streams.This is a performance hit for me. Is there a solution in sight?

stdlib streams are slower than gcc or KAI streams. This is a performance hit for me. Is there a solution in sight?

Our default (ANSI) standard streams are not implemented very efficiently. The underlying RogueWave (RW) streams implementation (version 2.1.1) does too many lseeks and writes out data inefficiently. RogueWave has fixed this problem in a subsequent version of stdlib (version 2.2.3),but that version is not binary compatible with the 2.1.1 version; hence, its not offered by default. Here are some workarounds that you can try to alleviate the problem:

o Use the -library=iostreams option. This uses "classic"
iostreams instead of standard streams. These classes are
known to be efficient. Unfortunately, using the classic
iostreams means that you cannot use stdlib features and
the whole program has to be compiled using
-library=iostreams. Use of classic iostreams may also
require some source code changes.

o Use the STL from STLport.org, along with the
-library=iostreams option. In both standard mode (the
default) and compatibility mode (-compat) this seems to
give a fairly reasonable performance (within 50% of
gcc).

o Use stdlib2.2.3 provided by RogueWave. Unfortunately,
this library is not compatible with stdlib2.1.1, which
is the default library provided with versions 5.0, 5.1,
and 5.2 of the compiler, and therefore may not work if
the application requires other middleware.
(Thanks to SOURCE : SUN DEVELOPMENT ARTICLE FROM sun.com ).

1 comment :

  1. Here is a chart showing the correspondence between Sun WorkShop and C++ compiler versions:

    SunWorkShop C++Compiler
    1.0 4.0
    2.0 4.1
    3.0 4.2
    [4.0VersionNumberNotUsed]
    5.0 5.0
    6(not6.0) 5.1
    6update1 5.2
    6 update 2 5.3

    ReplyDelete