Changeset 1773


Ignore:
Timestamp:
Dec 13, 2011, 1:16:47 PM (7 years ago)
Author:
vla24
Message:

Reverted table expansion decision changes. It slows down performance

Location:
trunk/symtab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/symtab/bitstream_hash_table_impl.h

    r1772 r1773  
    6363    CHAIN* next = m_table[bucket];
    6464    unsigned int chainlgth = chainLength(next);
    65 //    if
    66     if (chainlgth == MAX_CHAIN && m_totalSymbols > m_maxSymbols)
     65    if (chainlgth == MAX_CHAIN)
    6766    {
    6867        //current chain length is maximum, expand the table
     
    7877    m_table[bucket] = curr;
    7978
    80     m_totalSymbols++;
    81 
    8279#if DEBUG_BHT
    8380    printf ("Given GID: %i | Stored GID: %i\n", gid, m_table[bucket]->GID);
     
    9693    CHAIN* next = m_table[bucket];
    9794    unsigned int chainlgth = chainLength(next);
    98 //    if (chainlgth == MAX_CHAIN)
    99     if (chainlgth == MAX_CHAIN && m_totalSymbols > m_maxSymbols)
     95    if (chainlgth == MAX_CHAIN)
    10096    {
    10197        //current chain length is maximum, expand the table
     
    112108    m_table[bucket] = curr;
    113109
    114     m_totalSymbols++;
    115 
    116110#if DEBUG_BHT
    117111    printf ("Given GID: %i | Stored GID: %i\n", gid, m_table[bucket]->GID);
     
    156150    m_table = tempTable;
    157151    m_tableSize = tempTableSize;
    158 
    159     m_maxSymbols = m_tableSize >> 1 + m_tableSize >> 2;
    160152}
    161153
     
    196188    m_table = tempTable;
    197189    m_tableSize = tempTableSize;
    198 
    199     m_maxSymbols = m_tableSize >> 1 + m_tableSize >> 2;
    200190}
    201191
  • trunk/symtab/bitstream_super_hash_table.h

    r1772 r1773  
    4949    unsigned int nextTableSize();
    5050    unsigned int chainLength(CHAIN* chain);
    51 
    52     unsigned int m_maxSymbols;
    53     unsigned int m_totalSymbols;
    5451};
    5552
    5653BitStreamSuperHashTable::BitStreamSuperHashTable()
    5754    :m_tableSize(DEFAULT_TABLE_SIZE)
    58     ,m_totalSymbols(0)
    5955{
    6056    m_table = allocateHashTable(m_tableSize);
     
    6359        printf ("Failed to allocate table!\n");
    6460    }
    65 
    66     m_maxSymbols = m_tableSize >> 1 + m_tableSize >> 2;
    6761}
    6862
Note: See TracChangeset for help on using the changeset viewer.