Skip to content
0:00 / 0:00

#std::vector#cppcon#cache-locality

Back to Basics: Almost Always Vector - Kevin Carpenter - CppCon 2024

CppCon

189K subscribers • 103 videos on Hallway • Conference channel

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Kevin Carpenter
  • Linked in the descriptionCppCon/CppCon2024

Beginner. No background in the topic needed.

27K views1 year ago1 recommendation

Programming languagesComputer scienceC++Data structuresPerformance and optimization

Kevin Carpenter explains why std::vector is the default container choice in C++ and how it performs compared to other data structures.

cppcon.org --- Back to Basics: Almost Always Vector - Kevin Carpenter - CppCon 2024 --- Are you a fresh face in the world of C++ development, or perhaps you've got a bit of experience under your belt? Have you ever stopped to marvel at just how often std::vector pops up? It's a thing of beauty, a structure you can just keep piling data into, effortlessly sort, search, insert, and delete from. But do you know the price you pay for all this convenience? What about when you need to expand the structure? Or when you're on the hunt for something specific? Ever dabbled with custom predicates to dynamically tweak your data? With a plethora of data structures at our disposal in the standard library, it's a head-scratcher why std::vector seems to steal the show. Join this talk to unravel the mystery behind why we almost always opt for std::vector, and learn how to wield it with maximum efficiency. --- Slides: github.com/CppCon/CppCon2024/blob/main/Presentations/Back_to… Work at Hudson River Trading (HRT): tinyurl.com/safxfctf --- Kevin Carpenter Kevin Carpenter, an experienced Software Engineer, excels in crafting high-availability C++ solutions for Linux and Windows, with expertise in transaction software, financial modelling, and system integration. As a Lead Project Engineer, he ensures secure, high-speed credit card transactions. In his prior position, he played a lead role in developing an interest rate risk model for large credit unions, enhancing legacy code, and optimizing ERP data integration. Kevin actively engages in the C++ community, volunteering at conferences like ACCU, CppCon, C++ on Sea, and SwiftCraft, where he holds key positions such as Speaker Liaison and Volunteer Coordinator/Chair. His diverse contributions to the C++ community showcase his commitment to excellence and drive for collaborative growth, leaving a lasting impact in the tech world. --- CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts. Annual CppCon Conference - cppcon.org linkedin.com/company/cppcon x.com/cppcon facebook.com/CppConference reddit.com/r/cppcon/ mastodon.social/@CppCon --- Videos Filmed & Edited by Bash Films: BashFilms.com YouTube Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk --- #cpp #cplusplus #cppcon #cppprogramming #cplusplusprogramming #softwaredevelopment #softwareengineering #coding #code #computerscience #technology #technews #pro

Why it's here

1 person recommends this

What people say. Recommended as a great explanation of why contiguous arrays are usually the most effective data structure for basic tasks.

u/Farlo1in r/C_Programming • Recommends

On “Completely new to c but is there a more effective way to create an inventory system than a structure array ”

For most basic tasks a big ass array is usually fine. Arrays make accessing individual members really easy and fast: https://godbolt.org/z/qbMMcKdjf I saw a C++ talk recently called Almost Always Vector (C++ `std::vector` is essentially an array that can change size when needed) that rings very true for these sorts of situations. Don't overthink it until you _need_ to (or you want to learn about specific optimizations); keep your code as simple as you can as long as you can.