<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cpu on Hammer's Blog</title><link>https://lkic1625.github.io/blog/cpu/</link><description>Recent content in Cpu on Hammer's Blog</description><generator>Hugo</generator><language>ko-kr</language><copyright>© 조원빈 - All rights reserved</copyright><lastBuildDate>Fri, 18 Sep 2026 13:41:12 +0900</lastBuildDate><atom:link href="https://lkic1625.github.io/blog/cpu/index.xml" rel="self" type="application/rss+xml"/><item><title>SIMD와 Vectorized Execution</title><link>https://lkic1625.github.io/simd-vectorized-execution/</link><pubDate>Fri, 18 Sep 2026 13:41:12 +0900</pubDate><guid>https://lkic1625.github.io/simd-vectorized-execution/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>SIMD란 &lt;strong>Single Instruction, Multiple Data&lt;/strong>의 줄임말이다. 하나의 연산을 동시에 작업하는 방식이다. 이러한 연산 방식은 현재 데이터베이스 시스템에서도 매우 유용하게 사용될 수 있다. 이에 대해서 알아보자.&lt;/p>
&lt;h2 id="simd">SIMD&lt;/h2>
&lt;p>SIMD 연산은 아주 기본적인 출발점부터 시작한다. 예를 들어 간단한 스칼라 연산을 여러번 반복하는 loop가 있다면 해당 loop는 당연하게도 해당 데이터를 가져오고, 비교하는 연산을 수행한다. 하지만 만약, AVX2의 256-bit register에 &lt;code>int32&lt;/code>를 넣을 시에는 8개의 데이터를 동시에 연산할 수 있을 것이다. 이것이 SIMD 연산의 개괄이다. 물론, 실제로는 8배로 빨라지진 않는다. 데이터를 DRAM에서 가져오고 처리하는 데에 드는 추가적인 병목이 있기 때문이다.&lt;/p></description></item><item><title>Cache Affinity와 Seastar</title><link>https://lkic1625.github.io/cache-affinity/</link><pubDate>Fri, 18 Sep 2026 13:40:59 +0900</pubDate><guid>https://lkic1625.github.io/cache-affinity/</guid><description>&lt;h2 id="intro">Intro&lt;/h2>
&lt;p>Cache Affinity란, 기본적으로 스케쥴링 영역에 해당하는 동작성이다. 이에 대한 정리를 practical 한 예시와 함께 정리해본다.&lt;/p>
&lt;h2 id="cache-affinity">Cache Affinity&lt;/h2>
&lt;p>CPU는 대략적으로 L1, L2, L3, DRAM으로 이루어지며 각 레벨에서의 연산은 기본적으로 단계를 넘어갈수록 매우커진다. 특히, DRAM에 있는 값을 가져오는 연산은 수백배 차이날 수 있다. 그렇기에 이러한 하드웨어 동작에서 중요한 것은 CPU cache에 실제로 해당 값이 있는지를 기반으로 동작의 판가름이 난다. 대략적인 지연시간(latency)는 아래와 같다.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>Register ~ 1 cycle
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>L1 ~ 4 cycles
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>L2 ~ 10~20 cycles
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>L3 ~ 수십 cycles
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>DRAM ~ 수백 cycles
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>기본적으로 이러한 캐시 친화성은 CPU 스케쥴링의 영역지만, 더 나아가 현대의 소프트웨어 설계 기법에서도 볼 수 있다.&lt;/p></description></item></channel></rss>