Here's a small test case that scans a set of integers and sums up the values. 

There are two pointers introduced in the _Rb_tree_node_base struct ( these are 
_M_prev and _M_next ) that store the sorted iteration order as nodes are 
inserted/deleted in the Red-Black tree which underlies the set/map 
implementation. The changes in stl_tree.h pertain to the support of these two 
pointers.

The reason for not enabling this by default is that the users should not 
mix-n-match STL set/map created by the new compiler with set/map code generated 
from an earlier compiler. This may lead to binary incompatibility issues due to 
the RB-tree node structure change. 

-Tx
Dibyendu


-----Original Message-----
From: C Bergström [mailto:codest...@osunix.org] 
Sent: Wednesday, June 01, 2011 11:08 AM
To: Das, Dibyendu
Cc: Open64-devel@lists.sourceforge.net
Subject: Re: [Open64-devel] Code Review Request for changes in STL tree 
implementation to speed up set<>/map<>

On Wed, Jun 1, 2011 at 1:18 PM, Das, Dibyendu <dibyendu....@amd.com> wrote:
> The attached changes in the stl_tree.h file ( present in
> ./trunk/osprey-gcc-4.2.0/libstdc++-v3/include/bits directory ) is for
> speeding up STL set<>/map<> implementation. This helps in cases where
> iterators are used over these tree-based containers to scan the container.
> For more details on this please see attached paper presented in SIPEW 2008 (
> Spec organized workshop ).
>
>
>
> At present this functionality is available only under a -D__OPEN64_FAST_SET
> flag.
>
>
>
> Can a gatekeeper please review this ?

Can you submit a reduced test case for this and explain more of why it
can't always be enabled.

#include <set>
#include <iostream>

using namespace std;
main()
{
    set<int> sInt;
    set<int>::iterator sIntItr;
    
    for ( int i = 0; i < 10; i++ )
        sInt.insert(i+2);

    int sum = 0;
    for ( sIntItr = sInt.begin(); sIntItr != sInt.end(); sIntItr++ ) 
        sum += *sIntItr;

    cout << "Sum = " << sum << endl;
}
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to