<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog on ⎨ Saurabh Kumar ⎬</title><link>https://saurabh-kumar.com/blog/</link><description>Recent content in Blog on ⎨ Saurabh Kumar ⎬</description><generator>Hugo</generator><language>en-US</language><copyright>Copyright © 2025, Saurabh Kumar.</copyright><lastBuildDate>Mon, 11 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://saurabh-kumar.com/blog/index.xml" rel="self" type="application/rss+xml"/><item><title>How I Optimized My Zsh Startup Time</title><link>https://saurabh-kumar.com/articles/2026/05/how-i-optimized-my-zsh-startup-time/</link><pubDate>Mon, 11 May 2026 00:00:00 +0000</pubDate><guid>https://saurabh-kumar.com/articles/2026/05/how-i-optimized-my-zsh-startup-time/</guid><description>&lt;p&gt;My zsh prompt was taking close to a second on a fresh terminal. Not catastrophic, but you feel it every time tmux spawns a new pane, which for me is constantly. The config had been growing for years and nobody had been auditing it.&lt;/p&gt;
&lt;p&gt;What follows is the audit, and the eight things I changed.&lt;/p&gt;
&lt;h2 id="measure-first"&gt;Measure first&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-zsh" data-lang="zsh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Cold-start benchmark (run a few times, watch the variance):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; i in &lt;span class="o"&gt;{&lt;/span&gt;1..5&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="nb"&gt;time&lt;/span&gt; zsh -i -c exit&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# In-shell flamegraph:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 1. Uncomment `zmodload zsh/zprof` at the top of .zshrc&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 2. Add `zprof` at the bottom&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 3. Open a new shell&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;zprof &lt;span class="p"&gt;|&lt;/span&gt; head -40
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;zprof&lt;/code&gt; is the one that helped most. It prints which function calls and &lt;code&gt;eval&lt;/code&gt;s are burning time, sorted by self-time and call count.&lt;/p&gt;</description></item><item><title>The Great Fork: How Redis Lost Its Soul and Valkey Found It</title><link>https://saurabh-kumar.com/articles/2026/01/the-great-fork-how-redis-lost-its-soul-and-valkey-found-it/</link><pubDate>Mon, 12 Jan 2026 00:00:00 +0000</pubDate><guid>https://saurabh-kumar.com/articles/2026/01/the-great-fork-how-redis-lost-its-soul-and-valkey-found-it/</guid><description>&lt;h2 id="the-moment-everything-changed"&gt;The Moment Everything Changed&lt;/h2&gt;
&lt;p&gt;Picture this: It&amp;rsquo;s March 2024, and somewhere in a conference room, executives at Redis Inc. are making a decision. They&amp;rsquo;re looking at their balance sheets, watching cloud giants like AWS and Google profit from offering managed Redis services, and they&amp;rsquo;re thinking: &lt;em&gt;This isn&amp;rsquo;t fair. We built this. Why are they making all the money?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So they pull the trigger. &lt;strong&gt;On March 20, 2024&lt;/strong&gt;, after fifteen years of operating under the BSD 3-clause license—one of the most permissive licenses in open source—they announce a switch to dual source-available licensing: RSALv2 and SSPLv1. The new licensing takes effect with Redis 7.4. The message is simple: you can still see our code, but if you want to build a business with it, we need our cut.&lt;/p&gt;</description></item><item><title>Default Apps 2025</title><link>https://saurabh-kumar.com/articles/2025/11/default-apps-2025/</link><pubDate>Wed, 05 Nov 2025 00:00:00 +0000</pubDate><guid>https://saurabh-kumar.com/articles/2025/11/default-apps-2025/</guid><description>&lt;p&gt;&lt;strong&gt;&amp;ldquo;Apps I’ve been using regularly this year.”&lt;/strong&gt; Heavily inspired by &lt;a href="https://micro.webology.dev/2025/10/29/default-apps-here-are-my/"&gt;Jeff
Triplett&lt;/a&gt;.
Catalogued by Robb Knight’s &lt;a href="https://defaults.rknight.me/"&gt;App Defaults&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Mail Client&lt;/strong&gt;: &lt;a href="https://www.edisonmail.com/"&gt;Edison Mail&lt;/a&gt; and gmail in browser&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Notes&lt;/strong&gt;: &lt;a href="https://obsidian.md"&gt;Obsidian&lt;/a&gt;, SimpleNotes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;To-Do&lt;/strong&gt;: &lt;a href="https://bulletjournal.com/"&gt;Bullet Journel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Photo Shooting&lt;/strong&gt;: iPhone, Canon 6D&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Photo Editing&lt;/strong&gt;: PhotoShop, Gimp&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Calendar&lt;/strong&gt;: &lt;a href="https://www.notion.com/product/calendar"&gt;Notion Calendar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloud File Storage&lt;/strong&gt;: iCloud + Google Drive&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RSS&lt;/strong&gt;: &lt;a href="https://netnewswire.com/"&gt;NetNewsWire&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contacts&lt;/strong&gt;: Apple Contacts &amp;amp; Google Contacts&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Browser&lt;/strong&gt;: Arc, Zen Browser and Safari&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chat&lt;/strong&gt;: Apple Messages, Discord, Slack&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bookmarks&lt;/strong&gt;: RainDrop.io&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read It Later&lt;/strong&gt;: Safari Reading List&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Word Processing&lt;/strong&gt;: Apple Pages&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Spreadsheets&lt;/strong&gt;: Google Sheets&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Presentations&lt;/strong&gt;: Figma&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shopping Lists&lt;/strong&gt;: Amazon&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Budgeting and Personal Finance&lt;/strong&gt;: paisa&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;News&lt;/strong&gt;: Perplexity.ai, &lt;a href="https://netnewswire.com/"&gt;NetNewsWire&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Music&lt;/strong&gt;: Youtube Music&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Password Management&lt;/strong&gt;: 1Password and Apple Passwords&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code Editor&lt;/strong&gt;: &lt;a href="https://zed.dev/"&gt;Zed&lt;/a&gt; &amp;amp; Cursor&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;VPN&lt;/strong&gt;: &lt;a href="https://adguard.com/en/welcome.html"&gt;AdGuard&lt;/a&gt;, Zscalar&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="bonus-items"&gt;Bonus Items&lt;/h3&gt;
&lt;p&gt;Important enough to include here, ordered roughly by how often I rely on each.&lt;/p&gt;</description></item><item><title>Notes on Understanding Hebbian Learning</title><link>https://saurabh-kumar.com/articles/2025/11/notes-on-understanding-hebbian-learning/</link><pubDate>Wed, 05 Nov 2025 00:00:00 +0000</pubDate><guid>https://saurabh-kumar.com/articles/2025/11/notes-on-understanding-hebbian-learning/</guid><description>Dive into Hebbian learning, the fundamental principle of how our brains learn and form memories. From Pavlov&amp;rsquo;s dogs to your morning coffee ritual, discover how neurons wire together through repetition.</description></item><item><title>Cut Django Database Latency by 50-70ms With Native Connection Pooling</title><link>https://saurabh-kumar.com/articles/2025/06/cut-django-database-latency-by-50-70ms-with-native-connection-pooling/</link><pubDate>Wed, 18 Jun 2025 00:00:00 +0000</pubDate><guid>https://saurabh-kumar.com/articles/2025/06/cut-django-database-latency-by-50-70ms-with-native-connection-pooling/</guid><description>&lt;p&gt;Your Django app is hemorrhaging database resources. Each HTTP request creates
and destroys expensive PostgreSQL connections, adding 50-70ms of latency your
users feel directly. This connection overhead costs you real money in cloud
environments where database CPU time translates to monthly bills.&lt;/p&gt;
&lt;p&gt;Django 5.1 (released August 7, 2024) eliminated this waste with native
connection pooling&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. Deploy the fix in under 10 minutes and watch your
database connection overhead drop by 60-80% while your response times improve by
10-30%.&lt;/p&gt;</description></item><item><title>Thoughts on Astral's ty: The Lightning-Fast Python Type Checker &amp; Language Server</title><link>https://saurabh-kumar.com/articles/2025/05/thoughts-on-astrals-ty-the-lightning-fast-python-type-checker-language-server/</link><pubDate>Fri, 09 May 2025 00:00:00 +0000</pubDate><guid>https://saurabh-kumar.com/articles/2025/05/thoughts-on-astrals-ty-the-lightning-fast-python-type-checker-language-server/</guid><description>&lt;p&gt;Python developers have long suffered from painfully slow type checkers. Running mypy on a large codebase? Time to grab a coffee. Need real-time type checking in your editor? Prepare for frustrating lag and occasional crashes. But what if type checking could be nearly instantaneous?&lt;/p&gt;
&lt;p&gt;Enter &lt;code&gt;ty&lt;/code&gt; (&lt;a href="https://github.com/astral-sh/ty"&gt;gh:astral-sh/ty&lt;/a&gt;), the latest tool from Astral—the team behind the wildly successful Ruff linter and &lt;code&gt;uv&lt;/code&gt; package manager. Still in pre-alpha, &lt;code&gt;ty&lt;/code&gt; is already turning heads with performance that makes existing solutions look like they&amp;rsquo;re running in slow motion.&lt;/p&gt;</description></item><item><title>Handling Django Authentication Redirects in HTMX Applications</title><link>https://saurabh-kumar.com/articles/2025/05/handling-django-authentication-redirects-in-htmx-applications/</link><pubDate>Fri, 02 May 2025 00:00:00 +0000</pubDate><guid>https://saurabh-kumar.com/articles/2025/05/handling-django-authentication-redirects-in-htmx-applications/</guid><description>&lt;p&gt;Ever been in the middle of building a slick Django app with HTMX when you hit
that authentication headache? You know the one - a user&amp;rsquo;s session times out,
they click something, and instead of getting a proper login page, they get a
weird login form fragment jammed into whatever DOM element was being updated.
Not exactly the seamless experience we&amp;rsquo;re going for!&lt;/p&gt;
&lt;p&gt;I ran into this problem recently and thought, &amp;ldquo;There&amp;rsquo;s got to be a better way.&amp;rdquo;
Spoiler alert: there is! Let me show you a simple middleware solution that makes
this authentication dance much smoother.&lt;/p&gt;</description></item><item><title>Efficiently Managing Mass URL Redirects with Nginx</title><link>https://saurabh-kumar.com/articles/2017/09/efficiently-managing-mass-url-redirects-with-nginx/</link><pubDate>Mon, 25 Sep 2017 00:00:00 +0000</pubDate><guid>https://saurabh-kumar.com/articles/2017/09/efficiently-managing-mass-url-redirects-with-nginx/</guid><description>&lt;p&gt;In this post, I&amp;rsquo;ll show you how to efficiently implement hundreds or even thousands of URL redirects on your server without sacrificing performance. We&amp;rsquo;ll use Nginx&amp;rsquo;s powerful &lt;code&gt;map&lt;/code&gt; module which creates optimized hash tables for fast lookups.&lt;/p&gt;
&lt;h2 id="creating-your-redirect-configuration"&gt;Creating Your Redirect Configuration&lt;/h2&gt;
&lt;p&gt;First, create a file called &lt;code&gt;redirects-map.conf&lt;/code&gt; where each line represents a single redirect rule in this format:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;old_location&amp;gt; &amp;lt;new_url&amp;gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can use two types of location specifications:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Simple path redirects&lt;/strong&gt;:&lt;/p&gt;</description></item></channel></rss>