RSS Amplifier

Steven Kalt · Nov 23, 2021

Practical Data-Oriented Design

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

TL;DR: A CPU has several kinds of memory. CPUs cache data in faster and slower memory as the data is used in computation. Reading from a slower cache tends to be more expensive than doing several math operations, even multiplication. Reducing memory usage can vastly speed up an application When possible, 8- or 16-bit integers instead of 32- or 64-bit pointers Using a struct of same-sized arrays…

TL;DR:

  • A CPU has several kinds of memory. CPUs cache data in faster and slower memory as the data is used in computation.
  • Reading from a slower cache tends to be more expensive than doing several math operations, even multiplication.
  • Reducing memory usage can vastly speed up an application
  • When possible, 8- or 16-bit integers instead of 32- or 64-bit pointers
  • Using a struct of same-sized arrays instead of an array of structs avoids padding used to align each struct.
  • store different kinds of objects in different Vecs or arrays and discard the discriminating information from the struct
  • store sparse data separate from common data, e.g. in hashmaps

Read on /notes/techniques/practical_data_oriented_design/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.