<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>def4ultx page</title>
    <link>https://def4ultx.fyi/</link>
    <description>Recent content on def4ultx page</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 13 Apr 2026 03:19:36 +0700</lastBuildDate>
    <atom:link href="https://def4ultx.fyi/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>About</title>
      <link>https://def4ultx.fyi/about/</link>
      <pubDate>Mon, 13 Apr 2026 03:19:36 +0700</pubDate>
      <guid>https://def4ultx.fyi/about/</guid>
      <description>&lt;h1 id=&#34;hi-im-def4ultx&#34;&gt;Hi, I&amp;rsquo;m def4ultx&lt;/h1&gt;</description>
    </item>
    <item>
      <title>Big O is lying to you. CPU cacheline is all that matter</title>
      <link>https://def4ultx.fyi/posts/cpu-cacheline/</link>
      <pubDate>Mon, 13 Apr 2026 03:19:36 +0700</pubDate>
      <guid>https://def4ultx.fyi/posts/cpu-cacheline/</guid>
      <description>&lt;p&gt;เคยสงสัยไหมครับว่าทำไม algorithm บางตัวถึงรันได้เร็วกว่าอีกอัน แม้จริงๆมันจะมี big o ที่แย่กว่า&lt;/p&gt;
&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;ปกติแล้วใน course Data Structure and Algorithm จะพูดถึงเรื่อง Asymptotic complexity หรือ Big O notation ว่า algorithm นั้นๆว่ามีความซับซ้อนเท่าไรในแง่ของ time and space ที่ใช้&lt;/p&gt;
&lt;p&gt;แต่่สวนนึงที่ไม่ค่อยได้พูดถึงกันก็ตือ notation อันนี้หมายถึง growth ของตัว algorithm นั้นๆด้วย&lt;/p&gt;
&lt;p&gt;ซึ่งทำให้เวลาที่เราเทียบว่า algorithm ไหนดีกว่า เราตัดหลายๆส่วนที่สำคัญออกไป เช่นค่า constant บางอย่างหรือแม้กระทั่ง hardware model ที่ถูก abstract ว่าไม่มีผลอะไร&lt;/p&gt;
&lt;p&gt;ผลลัพธ์ก็คือตอนที่เราเอาของไปรันจริงๆ มันทำงานได้ดันช้ากว่าซะได้&lt;/p&gt;
&lt;h2 id=&#34;memory-hierarchy&#34;&gt;Memory Hierarchy&lt;/h2&gt;
&lt;p&gt;ทั่วไปแล้วเราจะมี model ในหัวว่า CPU มี L1/L2/L3, RAM และ cost ในการเข้าถึง data ต่างๆที่อยู่ในแต่ละที่นั้นใกล้ๆเคียงกัน แต่ความจริงแล้วมันไม่ใช่เลย&lt;/p&gt;
&lt;p&gt;เราจะเห็นได้ว่า cost ในการ access memory ส่วนต่างๆที่ยิ่งไกลออกไปนั้นมันจะสูงขึ้นอย่างเร็ว (อย่างเช่นใน diagram)&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
