Skip to main content

Which Container Should I Use?

  • Conference paper
  • First Online:
  • 408 Accesses

Part of the book series: Lecture Notes in Networks and Systems ((LNNS,volume 59))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. Malik, D.S.: Data structures using C. Course Technology/Cengage Learning India (2012)

    Google Scholar 

  2. Cormen, T.H., Leiserson, C.E.: Introduction to Algorithms, 3rd edn. The MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  3. 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)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. Adcock, C.M.S.: Improving cache performance by runtime data movement. University of Cambridge (2009)

    Google Scholar 

  6. Dudziak, T., Herter, J.: Cache analysis in presence of pointer-based data structures. ACM SIGBED Rev. 8, 7–10 (2011)

    Article  Google Scholar 

  7. Larus, J., Hill, M., Chilimbi, T.: Making pointer-based data structures cache conscious. Computer 33, 67–74 (2000)

    Article  Google Scholar 

  8. Josuttis, N.M.: The C Standard Library: A Tutorial and Reference. Addison-Wesley, Boston (2015)

    Google Scholar 

  9. CPU-World: Intel Core i7-3610QM specifications. http://www.cpu-world.com/CPUs/Core_i7/Intel-Core%20i7-3610QM%20Mobile%20processor.html

  10. CPU-World: Intel Core i5-3337U specifications. http://www.cpu-world.com/CPUs/Core_i5/Intel-Core%20i5-3337U%20Mobile%20processor.html

  11. 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

  12. CPU-World: AMD Athlon 64 TF-20 specifications. http://www.cpu-world.com/CPUs/K8/AMD-Athlon%2064%20TF-20%20-%20AMGTF20HAX4DN.html

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Esmira Muslija .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics