• No results found

Chapter 6: Smart data structures for NPs

6.7 Comparative Analysis

For the evaluation of the algorithms proposed in previous sections and the comparison with other known in literature, the Network Processor Intel IXP2800 has been taken as referential hardware architecture.

As shown in tab. 6.2, we have weighted the operations of the algorithms in terms of clock cycles for microengines. Microengines are just the processors designed to handle fast data path; the operations weights are set according to the IXP2800 Hardware Reference Manual [61]. For the construction of a MPHF, we have simulated the algorithm in [75] and measured its cost.

Each algorithm has been simulated and its performance has been mea- sured in terms of memory consumption and processing load for lookup and insertion/deletion. In simulation runs, the total number of data elements is

n = 2000, k = 10, and the number of bins for the main vector is 2.8×104, thus

minimizing the probability of false positives. For the algorithms which divide data structure in subsegments, the number of blocks is B = 64. All other pa- rameters are set to obtain about the same probability of false positives among the dierent algorithms and to be able to manage the same number n of el- ements. Moreover, for the algorithms which present a hierarchical structure, we have located each substructure in the fastest memory as possible (see tab. 6.5).

In ML-HCBF, we have set a conguration of four layers (2, 2, 3, 3). The rst vector CBF V has been stored in scratchpad memory, thus a lookup

requires accesses to scratchpad. Vectors HBV1, HBV2and HBV3 can be lo-

cated in local memory, thus an insertion/deletion needs also a certain number of accesses to this memory. However, in this layer conguration the probabil- ity of overowing CBF V is very low (0.033), thus accesses to local memory are not frequent.

Table 6.2: Number of Clock Cycles for Operations in the IXP2800

Operations Number of cycles

hash 10

popcount 1

shift 1

read/write in local memory 2

read/write in scratchpad memory 60

construction of a MPHF 1000

Concerning ML-CCBF, the main BF vector L0and index tables are stored

in local memory, while the remaining vectors in scratchpad. A lookup only requires checking the rst vector, therefore only local memory is accessed. For insertion and deletion we still need to explore dierent layers in the structure, thus both memories are accessed.

For a standard CBF, built with four bits for bin, the overall structure has been located in scratchpad. Therefore lookup, insertion and deletion require accesses to this memory.

With the data of our simulation, DCF does not experiment any overow of counters in CBF vector. Therefore, Overow Counter Vector are not necessary and DCF exhibits exactly the same behavior of CBF, in terms of both size and complexity.

Regarding HSBF, we have stored in scratchpad the main structure and in local memory the index tables. As said above, a lookup requires, for each hash function, to check the table in local memory, to search for the corresponding block in scratchpad for the bin we need and to compute a popcount. The same number of operations are required for inserting/deleting an element, with the addition of shifting by one position the bits in the bin, to increment/decrement a counter. Remember that HSBF is a simple alternative version of SBF, which is a structure optimized for multi-set. SBFs use, for values greater than 2, Elias code instead of Human code and several more index tables, thus resulting in higher memory consumption and operational complexity.

Finally, the overall unique structure of dlCBF has been located in scratch- pad. A lookup requires 2k hashing and k accesses to scratchpad, while an insertion or a deletion needs 2k hashing, k accesses to scratchpad and, nally,

k incrementing or decrementing operations.

From results in tab. 6.5, it is clear that the solutions proposed in this paper show a signicant memory saving in comparison with standard CBF and

DCF (saving of 46% for ML-HCBF, 56% for ML-CCBF, and 54% for HSBF), and also compared to SBF. Instead, there is a memory consumption increase in comparison with dlCBF (from 0.93 KB up to 2.35 KB). Hovewer, our methods, inspired by dynamic approaches (e.g. DCF), avoid in a conclusive way the problem of counters overow, thus preserving the accuracy of stored information.

Moreover, the introduction of a hierarchical structure allows in ML-CCBF a remarkable decrease of clock cycles for the lookup operation. Indeed, the main structure is stored in local memory, thus enabling lookup by accessing local memory only. The membership query is the most frequent operation for these data structures, therefore the reduction of about 83% of clock cycles for lookup is a great outcome. It outweighs the drawback of an increase of 50% of processing for inserting/deleting an element.

Finally, note that our HSBF outperforms SBF, in terms of memory con- sumption and operational complexity. This is an expected result, due to the simplicity of our method and to the use of Human code (SBFs are opti- mized for multi-sets). If compared to the complexity of standard algorithms, HSBF shows a reduction of 13% for lookup and an increase of 45% for inser- tion/deletion. The dierent frequency of operations allows to claim that the tradeo is advantageous.