<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="pretty-atom-feed.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  
  <title>Blog Title</title>
  <subtitle>This is a longer description about your blog.</subtitle>
  <link href="https://example.com/feed/feed.xml" rel="self" />
  <link href="https://example.com/" />
  <updated>2024-10-24T00:00:00Z</updated>
  <id>https://example.com/</id>
  <author>
    <name>Your Name</name>
  </author>
  <entry>
    <title>Sizeof node_modules/ – Performance testing</title>
    <link href="https://example.com/blog/2024/sizeof-node-modules/performance-writeup/" />
    <updated>2024-10-24T00:00:00Z</updated>
    <id>https://example.com/blog/2024/sizeof-node-modules/performance-writeup/</id>
    <content type="html">&lt;h2 id=&quot;detailed-stats-root-directory&quot;&gt;Detailed Stats — Root Directory&lt;/h2&gt;
&lt;p&gt;The command:&lt;/p&gt;
&lt;pre class=&quot;language-shell&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; ~/Documents
/usr/bin/time &lt;span class=&quot;token parameter variable&quot;&gt;-lp&lt;/span&gt; ~/Documents/Personal/byte-bin/shell/sizeof_node_modules.sh &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; /dev/null&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;original-edition&quot;&gt;Original Edition&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;real 34.18
user 0.92
sys 13.49
             3145728  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
                5104  page reclaims
                  75  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   5  signals received
              109160  voluntary context switches
               54699  involuntary context switches
            25517294  instructions retired
            20511231  cycles elapsed
             1491712  peak memory footprint
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;latest-performance-optimized-bash&quot;&gt;Latest Performance Optimized (bash)&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;real 12.65
user 0.18
sys 4.09
             3276800  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
                1210  page reclaims
                  25  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   0  signals received
               68323  voluntary context switches
                 633  involuntary context switches
            10843535  instructions retired
             6067801  cycles elapsed
             1016512  peak memory footprint
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;latest-performance-optimized-zsh&quot;&gt;Latest Performance Optimized (zsh)&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;real 13.03
user 0.18
sys 4.18
             2850816  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
                1418  page reclaims
                  20  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   3  signals received
               68336  voluntary context switches
                1559  involuntary context switches
            22563567  instructions retired
            16826761  cycles elapsed
             1377024  peak memory footprint
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;detailed-stats-simple-directory&quot;&gt;Detailed Stats — Simple Directory&lt;/h2&gt;
&lt;p&gt;The command:&lt;/p&gt;
&lt;pre class=&quot;language-shell&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; ~/Documents/Personal/byte-bin/shell
/usr/bin/time &lt;span class=&quot;token parameter variable&quot;&gt;-lp&lt;/span&gt; sizeof_node_modules.sh &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; /dev/null&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;latest-edition&quot;&gt;Latest Edition&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;real 0.00
user 0.00
sys 0.00
             2146304  maximum resident set size
                   0  average shared memory size
                   0  average unshared data size
                   0  average unshared stack size
                 958  page reclaims
                  17  page faults
                   0  swaps
                   0  block input operations
                   0  block output operations
                   0  messages sent
                   0  messages received
                   3  signals received
                  24  voluntary context switches
                  44  involuntary context switches
            22624389  instructions retired
            11315148  cycles elapsed
             1426176  peak memory footprint
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;individual-steps&quot;&gt;Individual Steps&lt;/h2&gt;
&lt;p&gt;The command:&lt;/p&gt;
&lt;pre class=&quot;language-shell&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; ~/Documents
/usr/bin/time &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; ~/Documents/Personal/byte-bin/shell/sizeof_node_modules.sh &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; /dev/null&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;original-edition-2&quot;&gt;Original Edition&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;       12.43 real         0.26 user         5.55 sys  # find **/node_modules -type d
       21.25 real         0.08 user         0.00 sys  # grep -E &amp;quot;node_modules$&amp;quot;
       21.25 real         0.00 user         0.00 sys  # grep -vE &amp;quot;node_modules/&amp;quot;
       21.28 real         0.00 user         0.02 sys  # xargs -I {} echo &#39;&amp;quot;{}&amp;quot;&#39;
       31.73 real         0.15 user         3.51 sys  # xargs du -hs
       31.73 real         0.00 user         0.00 sys  # sort -hr

# Overall shell command
real 31.74
user 0.91
sys 13.13
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;optimized-edition&quot;&gt;Optimized Edition&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;        2.21 real         0.02 user         0.61 sys  # find $DIR -type d -name &amp;quot;node_modules&amp;quot; -prune -print0
       12.63 real         0.15 user         3.50 sys  # xargs -0 du -hs
       12.64 real         0.00 user         0.00 sys  # sort -hrS 4K

# Overall shell command
real 12.93
user 0.18
sys 4.12
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>TMUX Reference</title>
    <link href="https://example.com/blog/2024/tmux/" />
    <updated>2024-10-21T00:00:00Z</updated>
    <id>https://example.com/blog/2024/tmux/</id>
    <content type="html">&lt;p&gt;&lt;em&gt;Tmux Info Shared by A Classmate:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Tmux infomercial coming in hot
At first I didn&#39;t really like using tmux, I was acustomed to just using my shells built in stuff to split panes and make new windows. Then I customized it a little bit and I really starting liking switching between sessions and that I can keep web severs running in other sessions etc. etc. and it just made context switching a lot easier. Here are some articles that guided me to this point. https://hamvocke.com/blog/a-quick-and-easy-guide-to-tmux/ and https://hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ and I think I stole this guys config more or less https://youtu.be/U-omALWIBos?t=101 (there are tons of videos on yt of people showing off way smancier tmux configs but this one was fancy and simple enough for my liking)&lt;/p&gt;
&lt;p&gt;first make a .tmux.conf at $HOME with touch .tmux.conf&lt;/p&gt;
&lt;p&gt;I attached two examples of the one what I use, the comments in them will explain what each thing does. The biggest changes are that I switch the prefix from ctrl + b to ctrl + a (easy one hand combo), another common thing is to change the keys for splitting panes - horizontal splits and | do vertical splits.&lt;/p&gt;
&lt;p&gt;I also bind prefix followed by vim nav keys (hjkl) to do pane resize as well as ctrl + vim nav keys to move arround (instead of arrow keys). You can further add a plugin to make this work with vim/neovim so it respects your window navigation within vim and tmux panes.&lt;/p&gt;
&lt;p&gt;Add the ability to use plugins by following the install guide here:
https://github.com/tmux-plugins/tpm
then in tmux do prefix I to install the plugins&lt;/p&gt;
&lt;p&gt;I also add a nice theme plugin along with two plugins for making your tmux session resurrect after closing it. One for doing just that and one which saves that state every 15 mins (you can also do prefix ctrl + s do maually save state). This way if you disconnect from the lab machines all you have to do is call tmux and your panes and other tmux sessions will restore to what they were before. Also add the ability to use the mouse and if you want to copy paste you can use vim keys (v and y or mouse select and y). If you start using mouse mode and want to return to the insert mode (back to typing in commands) you can type q and that will drop you back to the bottom of your terminal and you can continue typing in shell commands.&lt;/p&gt;
</content>
  </entry>
</feed>