[{"data":1,"prerenderedAt":74},["ShallowReactive",2],{"term-s\u002Fsimd":3,"related-s\u002Fsimd":60},{"id":4,"title":5,"acronym":6,"body":7,"category":40,"description":41,"difficulty":42,"extension":43,"letter":44,"meta":45,"navigation":46,"path":47,"related":48,"seo":53,"sitemap":54,"stem":57,"subcategory":58,"__hash__":59},"terms\u002Fterms\u002Fs\u002Fsimd.md","SIMD","Single Instruction, Multiple Data",{"type":8,"value":9,"toc":33},"minimark",[10,15,19,23,26,30],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 - The Vibe Check",[16,17,18],"p",{},"SIMD is a CPU trick where instead of adding two numbers at a time, the processor adds eight, or sixteen, or thirty-two pairs of numbers in the exact same instruction, all at once. It's why a loop that does the same simple math over a big array of numbers can suddenly run several times faster once the compiler figures out how to vectorize it.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"SIMD is a class of CPU instructions that apply the same operation to multiple data elements simultaneously using wide registers, for example adding eight pairs of 32-bit integers in a single instruction via AVX2. Compilers can auto-vectorize simple loops to use SIMD instructions automatically, and libraries for numerical computing, image processing, and machine learning rely heavily on hand-written or compiler-generated SIMD code for their speed.",[11,27,29],{"id":28},"when-youll-hear-this","When You'll Hear This",[16,31,32],{},"\"The compiler auto-vectorized that loop into SIMD instructions, that's why it's so fast.\" \u002F \"NumPy is fast partly because it dispatches to SIMD-optimized C under the hood.\"",{"title":34,"searchDepth":35,"depth":35,"links":36},"",2,[37,38,39],{"id":13,"depth":35,"text":14},{"id":21,"depth":35,"text":22},{"id":28,"depth":35,"text":29},"backend","SIMD is a CPU trick where instead of adding two numbers at a time, the processor adds eight, or sixteen, or thirty-two pairs of numbers in the exact same i...","advanced","md","s",{},true,"\u002Fterms\u002Fs\u002Fsimd",[49,50,51,52],"Branch Prediction","Cache Line","Perf Counters","Benchmarking",{"title":5,"description":41},{"changefreq":55,"priority":56},"weekly",0.7,"terms\u002Fs\u002Fsimd",null,"JFUPHrbjqCSLYC2HRPAAyhCKGFEgTqktUDRDzTc6m5c",[61,65,68,71],{"title":52,"path":62,"acronym":58,"category":40,"difficulty":63,"description":64},"\u002Fterms\u002Fb\u002Fbenchmarking","intermediate","Benchmarking is timing your code to prove it's actually fast, and it is shockingly easy to do wrong.",{"title":49,"path":66,"acronym":58,"category":40,"difficulty":42,"description":67},"\u002Fterms\u002Fb\u002Fbranch-prediction","Modern CPUs don't wait around to find out if an if statement is true, they guess the answer and start executing down that path before they even know for su...",{"title":50,"path":69,"acronym":58,"category":40,"difficulty":42,"description":70},"\u002Fterms\u002Fc\u002Fcache-line","Your CPU never fetches just the one byte you asked for, it grabs a whole chunk around it, usually 64 bytes, called a cache line, on the theory that you'll...",{"title":51,"path":72,"acronym":58,"category":40,"difficulty":42,"description":73},"\u002Fterms\u002Fp\u002Fperf-counters","Perf counters are the CPU's own built-in scorekeepers, tiny hardware registers that silently count things like cache misses, branch mispredictions, and ins...",1792528120046]