Abstract
In this paper we present results of performance testing we performed on three containers from the standard library: vector , map and unordered_map . The goal of this work is to make practical guidelines in order to help programmers choose the right container for a particular use case. We made a series of tests that resembles different circumstances that can come in real world applications. In order to make better conclusions, tests were performed on four different computer configurations and processors. Our initial hypothesis is that the performance of containers not only depends on their general complexity that is a consequence of their internal design and algorithms as such, but should additionally be connected to cache utilization. After analysis of the results obtained, we made several conclusions in terms of better use of C++ containers in particular use cases.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsReferences
Malik, D.S.: Data structures using C. Course Technology/Cengage Learning India (2012)
Cormen, T.H., Leiserson, C.E.: Introduction to Algorithms, 3rd edn. The MIT Press, Cambridge (2009)
Irazoqui, G., Eisenbarth, T., Sunar, B.: Systematic reverse engineering of cache slice selection in Intel processors. In: 2015 Euromicro Conference on Digital System Design (2015)
Truong, D., Bodin, F., Seznec, A.: Improving cache behavior of dynamically allocated data structures. In: Proceedings of 1998 International Conference on Parallel Architectures and Compilation Techniques (Cat. No. 98EX192) (1998)
Adcock, C.M.S.: Improving cache performance by runtime data movement. University of Cambridge (2009)
Dudziak, T., Herter, J.: Cache analysis in presence of pointer-based data structures. ACM SIGBED Rev. 8, 7–10 (2011)
Larus, J., Hill, M., Chilimbi, T.: Making pointer-based data structures cache conscious. Computer 33, 67–74 (2000)
Josuttis, N.M.: The C Standard Library: A Tutorial and Reference. Addison-Wesley, Boston (2015)
CPU-World: Intel Core i7-3610QM specifications. http://www.cpu-world.com/CPUs/Core_i7/Intel-Core%20i7-3610QM%20Mobile%20processor.html
CPU-World: Intel Core i5-3337U specifications. http://www.cpu-world.com/CPUs/Core_i5/Intel-Core%20i5-3337U%20Mobile%20processor.html
CPU-World: Intel Pentium M 740 (Socket 479) specifications. http://www.cpu-world.com/CPUs/Pentium_M/Intel-Pentium%20M%20740%20RH80536GE0302M%20(BX80536GE1733FJ).html
CPU-World: AMD Athlon 64 TF-20 specifications. http://www.cpu-world.com/CPUs/K8/AMD-Athlon%2064%20TF-20%20-%20AMGTF20HAX4DN.html
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Muslija, E., Pjanić, E. (2019). Which Container Should I Use?. In: Avdaković, S. (eds) Advanced Technologies, Systems, and Applications III. IAT 2018. Lecture Notes in Networks and Systems, vol 59. Springer, Cham. https://doi.org/10.1007/978-3-030-02574-8_39
Download citation
DOI: https://doi.org/10.1007/978-3-030-02574-8_39
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-02573-1
Online ISBN: 978-3-030-02574-8
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)