<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Random &amp;mdash; G&#39;s Blog</title>
    <link>https://blog.marcg.pizza/marcg/tag:Random</link>
    <description>Just a place to post random things. Enjoy your stay.</description>
    <pubDate>Sat, 18 Apr 2026 06:53:33 -0300</pubDate>
    <item>
      <title>### How many instructions to print Hello World  (#100DaysToOffload Day7)</title>
      <link>https://blog.marcg.pizza/marcg/how-many-instructions-to-print-hello-world-100daystooffload-day7</link>
      <description>&lt;![CDATA[### How many instructions to print Hello World  (#100DaysToOffload Day7)&#xA;&#xA;So this was supposed to go up yesterday but i passed out so here it is late.&#xA;&#xA;About a week ago i saw a post talking about the (over)complexity of technology that keeps getting more and more complex in some ways seemingly to justify it&#39;s own complexity. In the process the fact that it took over 600k instructions to print the word &#34;test&#34; on a terminal window was pointed out. Since this was from 4 years ago i wondered how much that had changed since.&#xA;&#xA;So here is the answer on my system.&#xA;&#xA;First a little system info:&#xA;&#xA;➤ cat /proc/cpuinfo | grep &#34;model name&#34;&#xA;model name : AMD Ryzen 5 2600X Six-Core Processor&#xA;&#xA;➤ uname -a&#xA;Linux thebeach 5.6.8-artix1-1 #1 SMP PREEMPT Wed, 29 Apr 2020 18:45:03 +0000 x86_64 GNU/Linux&#xA;&#xA;Now the test&#xA;&#xA;➤ sudo perf stat echo &#34;Hello World&#34;&#xA;Hello World&#xA;&#xA; Performance counter stats for &#39;echo Hello World&#39;:&#xA;&#xA;              0.54 msec task-clock                #    0.478 CPUs utilized          &#xA;                 0      context-switches          #    0.000 K/sec                  &#xA;                 0      cpu-migrations            #    0.000 K/sec                  &#xA;                62      page-faults               #    0.115 M/sec                  &#xA;         2,157,767      cycles                    #    3.999 GHz                    &#xA;           275,729      stalled-cycles-frontend   #   12.78% frontend cycles idle   &#xA;           169,688      stalled-cycles-backend    #    7.86% backend cycles idle    &#xA;           877,604      instructions              #    0.41  insn per cycle         &#xA;                                                  #    0.31  stalled cycles per insn&#xA;           187,115      branches                  #  346.745 M/sec                  &#xA;     not counted      branch-misses                                                 (0.00%)&#xA;&#xA;       0.001129028 seconds time elapsed&#xA;&#xA;       0.000000000 seconds user&#xA;       0.001178000 seconds sys&#xA;&#xA;So there you have it 877,604 instructions to echo &#34;Hello World&#34;. I wont pretend to understand computer at that low level  but that&#39;s an increase of 200k in 4 years to print a simple string. Part of this increase probably relates to mitigations for things like Spectre and Meltdown and some other &#34;optimizations&#34; over the years.&#xA;&#xA;Well that is all for today.&#xA;&#xA;Until tomorrow stay safe!&#xA;&#xA;@mgrondin@youdabomb.social&#xA;&#xA;#Tech #Random&#xA;&#xA;Until next time. Stay safe!&#xD;&#xA;&#xD;&#xA;G&#xD;&#xA;@mgrondin@youdabomb.social]]&gt;</description>
      <content:encoded><![CDATA[<h3 id="how-many-instructions-to-print-hello-world-100daystooffload-day7">How many instructions to print Hello World  (<a href="/marcg/tag:100DaysToOffload" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">100DaysToOffload</span></a> Day7)</h3>

<p>So this was supposed to go up yesterday but i passed out so here it is late.</p>

<p>About a week ago i saw a post talking about the (over)complexity of technology that keeps getting more and more complex in some ways seemingly to justify it&#39;s own complexity. In the process the fact that it took over <a href="https://gist.github.com/zloster/bcf82dd558fc5733851455180fa37a49" rel="nofollow">600k instructions</a> to print the word “test” on a terminal window was pointed out. Since this was from 4 years ago i wondered how much that had changed since.</p>

<p>So here is the answer on my system.</p>

<p>First a little system info:</p>

<pre><code>➤ cat /proc/cpuinfo | grep &#34;model name&#34;
model name : AMD Ryzen 5 2600X Six-Core Processor
</code></pre>

<pre><code>➤ uname -a
Linux thebeach 5.6.8-artix1-1 #1 SMP PREEMPT Wed, 29 Apr 2020 18:45:03 +0000 x86_64 GNU/Linux
</code></pre>

<p>Now the test</p>

<pre><code>➤ sudo perf stat echo &#34;Hello World&#34;
Hello World

 Performance counter stats for &#39;echo Hello World&#39;:

              0.54 msec task-clock                #    0.478 CPUs utilized          
                 0      context-switches          #    0.000 K/sec                  
                 0      cpu-migrations            #    0.000 K/sec                  
                62      page-faults               #    0.115 M/sec                  
         2,157,767      cycles                    #    3.999 GHz                    
           275,729      stalled-cycles-frontend   #   12.78% frontend cycles idle   
           169,688      stalled-cycles-backend    #    7.86% backend cycles idle    
           877,604      instructions              #    0.41  insn per cycle         
                                                  #    0.31  stalled cycles per insn
           187,115      branches                  #  346.745 M/sec                  
     &lt;not counted&gt;      branch-misses                                                 (0.00%)

       0.001129028 seconds time elapsed

       0.000000000 seconds user
       0.001178000 seconds sys
</code></pre>

<p>So there you have it 877,604 instructions to echo “Hello World”. I wont pretend to understand computer at that low level  but that&#39;s an increase of 200k in 4 years to print a simple string. Part of this increase probably relates to mitigations for things like Spectre and Meltdown and some other “optimizations” over the years.</p>

<p>Well that is all for today.</p>

<p>Until tomorrow stay safe!</p>

<p><a href="https://blog.marcg.pizza/@/mgrondin@youdabomb.social" class="u-url mention" rel="nofollow">@<span>mgrondin@youdabomb.social</span></a></p>

<p><a href="/marcg/tag:Tech" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Tech</span></a> <a href="/marcg/tag:Random" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Random</span></a></p>

<p>Until next time. Stay safe!</p>

<p>G
<a href="https://blog.marcg.pizza/@/mgrondin@youdabomb.social" class="u-url mention" rel="nofollow">@<span>mgrondin@youdabomb.social</span></a></p>
]]></content:encoded>
      <guid>https://blog.marcg.pizza/marcg/how-many-instructions-to-print-hello-world-100daystooffload-day7</guid>
      <pubDate>Fri, 01 May 2020 09:05:38 -0300</pubDate>
    </item>
  </channel>
</rss>