comparison mrjunejune/src/blog/optimizing-data-structures/index.md @ 173:827c6ac504cd hg-web

Merged in default here.
author MrJuneJune <me@mrjunejune.com>
date Mon, 19 Jan 2026 18:59:10 -0800
parents 295ac2e5ec00
children
comparison
equal deleted inserted replaced
151:c033667da5f9 173:827c6ac504cd
1 ---
2 title: Optimizing Data Structures for Performance
3 description: Understanding how memory layout affects cache performance in C++ games, with examples of pointer indirection and contiguous data structures.
4 ---
5
1 ### Optimizing Data Structures for Performance 6 ### Optimizing Data Structures for Performance
2 7
3 In my professional experience as a full-stack engineer, I primarily work with languages like Python, JavaScript, and Ruby, which don’t provide strict control over memory management. Contract work requiring languages like C or C++ is rare, as most clients prefer "modern" languages that prioritize ease of use over low-level control. Even on the few occasions when I did write C or C++ code, my focus was not on performance optimization. However, I recently observed some C++ code that changed my perspective. 8 In my professional experience as a full-stack engineer, I primarily work with languages like Python, JavaScript, and Ruby, which don’t provide strict control over memory management. Contract work requiring languages like C or C++ is rare, as most clients prefer "modern" languages that prioritize ease of use over low-level control. Even on the few occasions when I did write C or C++ code, my focus was not on performance optimization. However, I recently observed some C++ code that changed my perspective.
4 9
5 Let’s consider creating a simple entity for a video game: 10 Let’s consider creating a simple entity for a video game: