Abstract
In this work we augment the red-black tree implementation of STL set< ... >/map< ... > with a doubly linked list that is in sorted order. This is done for the purpose of speeding up C++ applications that use set< >/map< >::iterator considerably. In such cases, the doubly linked list helps in iterating over the set< >/map< > quickly. Usually the ++/– operations have an amortized cost of O(1) for a red-black tree implementation. The linked list augmentation helps in improving the ++/– operations to Θ(1). In addition, our experiments for IBM’s P5+ and P6 processors show that this mechanism improves performance for two SPEC CPU2006 benchmarks and there is no adverse cache effect when we support two additional pointers per node of a red-black tree.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Meyers, S.: Effective STL. Addison Wesley Professional Computing Series (2001)
Bronimann, H., Katajainen, J.: Efficiency of Various Forms of Red-Black Trees. CPH STL Report 2006-2, University of Copenhagen (2006)
Hansen, J.G., Henriksen, A.K.: The Multi map/set of the Copenhagen STL. CPH STL Report 2001-6, University of Copenhagen (2001)
Lynge, S.: Implementing the AVL Trees for the CPH STL. CPH STL Report 2004-1, University of Copenhagen (2004)
Cormen, H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms. Prentice- Hall, India (2006)
SPEC CPU 2006 benchmarks, http://www.spec.org
Stepanov, A., Lee, M.: The Standard Template Library, Technical Report HPL-95-11, Hewlett Packard (1995)
ISO/IEC 14882:1998 and ISO/IEC 14882:2003(E) Standard for the C++ Programming Language
pmcount, http://www-128.ibm.com/developerworks/power/library/pa-cpipower2/
IBM XL Compilers and White Papers, http://www.ibm.com/software/awdtools/ccompilers http://www1.ibm.com/support/docview.wss?rs=32&context=SSEP5D&uid=swg27007322 http://www-1.ibm.com/support/docview.wss?rs=43&context=SSEP9Q&uid=swg27005175
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Das, D., Valluri, M., Wong, M., Cambly, C. (2008). Speeding up STL Set/Map Usage in C++ Applications. In: Kounev, S., Gorton, I., Sachs, K. (eds) Performance Evaluation: Metrics, Models and Benchmarks. SIPEW 2008. Lecture Notes in Computer Science, vol 5119. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-69814-2_20
Download citation
DOI: https://doi.org/10.1007/978-3-540-69814-2_20
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-69813-5
Online ISBN: 978-3-540-69814-2
eBook Packages: Computer ScienceComputer Science (R0)