3 ms·
OO encourages objects graphs scattering your data unpredictably in memory and modern CPU:s likes to have it's data in continuous memory area where it can do pre
by JanneVee 3y ago
OO encourages objects graphs scattering your data unpredictably in memory and modern CPU:s likes to have it's data in continuous memory area where it can do prefetching and prediction on where your data resides.
- gonzo41 3y agoThat's not really true anymore. RAM is so big these days that most databases can fit into it and be blazingly fast. It's all the classic shit that slows people down. Loops in loops in loops in loop with nested if's. Not understanding the correct way to structure IF statements (Common case first etc).
- shrimp_emoji 3y ago> RAM is so big these days that most databases can fit into it and be blazingly fast. ... Compared to L3 cache? Isn't that still at least 10 times faster? That probably only matters in high performance projects though. > the correct way to structure IF statements (Common case first etc) But muh early returns on error D:
- tmtvl 3y agoAccording to Intel* RAM is about 2x L3 cache. Which is about 10x L2, which is about 4x L1. So: RAM := 1 L3 := 2 L2 := 20 L1 := 80 * https://www.intel.com/content/www/us/en/developer/articles/technical/memory-performance-in-a-nutshell.html https://www.intel.com/content/www/us/en/developer/articles/t...
- _aavaa_ 3y agoThat's latency, and it's for a 16 core. The bandwith is shown there to be at least 1/4.
- gonzo41 3y agoThe point I was making is that a trip to disk is generally not occurring, and that having a soup of pointers in RAM isn't as bad having badly laid out memory on disk that needs to be paged in. Most performance being lost, isn't from memory layout patterns and not getting full pages. It's not even that much from bad branch prediction. Most of the bad performance these days is the stacks of extra app layers that exists for little benefit.
- JanneVee 3y agoAnd I see comments saying that Casey is doing some strawman thing here and yet here you are with claim "1. No need". I'm just coming here with personal experience and my own anecdote that memory layout does matter even on modern CPU:s and it isn't niche. And because it was designed with OO mindset there wasn't any quick fix available.