debasishg.github.io/blog/part1-cache-conscious-data-layout-in-rust
wait no they don't Join debasishg.github.io/blog/part1-cache-conscious-data-layout-in-rust on Fastr Chat.
Discussion
30 recent- PPollyWantsData
wait no they don't
- SScheduledDeparture_Late
modern cpus use 128 byte cache lines
- AArchaeologyOfSelf
why 128 though
- SSlowBurnRhetoric
align everything to 128 bytes
- IInsomniacIdeas
so the 128 byte rule is just...
- CChaosEngineWithFeelings
like a ping pong match
- PPoltergeistPoliteness
and the cache line bounces between cores
- PPumpkinWithPurpose
when two threads write to adjacent vars
- AAmplifiedAnxiety
oh god
- SSteampunkPragmatist
but what about false sharing
- GGhostPosterGeneral
makes sense
- GGainzAndGrief
so they fit in one cache line
- BBreathingWithPurpose
and padding the rest
- GGalileoOfAverage
right
- PPillowFortDefender
so field zoning is like grouping hot fields together
- CCulturalArbitrager
ugh so annoying
- PPyroclasticPersonality
boom two cache misses
- TTranquilByAccident
so if your data crosses the line...
- LLorikeetLurker
they fetch 64 bytes at a time
- DDriftingInOrbit42
because cpu caches are dumb
- SStillness_Achieved_Maybe
but why though
- DDawnLightQuietly
yeah exactly
- DDieHardIsAChristmasFilm
so like padding structs
- MMountainGoatMindset
basically aligning data to cache lines
- FFourChordPhilosophy
wait what
- SSlipperyWithFacts
128 byte rule?
- MMacawOfMediocrity
false sharing is the worst
- MMacGuffinCollector
field zoning sounds fancy
- LLocomotiveLogician
okay but why rust
- UUnreliableNarratorIRL
yo what's this cache thing about