<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://mellowfish.blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://mellowfish.blog/" rel="alternate" type="text/html" /><updated>2025-04-09T21:12:50-05:00</updated><id>https://mellowfish.blog/feed.xml</id><title type="html">A man in #000000</title><subtitle>Reformed Christianity + Software Development</subtitle><author><name>Christopher Coleman</name></author><entry><title type="html">Special Interest(s) vs Expertise</title><link href="https://mellowfish.blog/autism/2025/04/09/special-interests-vs-expertise" rel="alternate" type="text/html" title="Special Interest(s) vs Expertise" /><published>2025-04-09T19:01:01-05:00</published><updated>2025-04-09T19:01:01-05:00</updated><id>https://mellowfish.blog/autism/2025/04/09/special-interests-vs-expertise</id><content type="html" xml:base="https://mellowfish.blog/autism/2025/04/09/special-interests-vs-expertise"><![CDATA[<p>As I have <a href="/autism/awareness/2023/04/05/what-is-autism#special-interests">discussed previously</a>, an important part of Autism is “Special Interests”.
Most Autistic people have at least one topic they have devoted many thousands of hours of their life to and have an encyclopedic knowledge of.
Some Autistic people have several of these, and if you also have ADHD (aka AuDHD, like myself) you may have hundreds.</p>

<h1 id="zipfs-law-as-applied-to-special-interests">Zipf’s Law (As Applied to Special Interests)</h1>

<p>Interesting side bar (because what would this be without one): My special interests follow <a href="https://en.wikipedia.org/wiki/Zipf%27s_law" target="_blank">Zipf’s Law</a>, which has to do with frequency of use vs length of word.
In my case, it plays out like this:</p>

<ul>
  <li>I have a single “main” special interest, Computer Programming, which I have studied since I was 8, went to school for, and have done professionally for almost 16 years.</li>
  <li>I have several other special interests that I have spent thousands of hours each(!) on.</li>
  <li>I have dozens of special interests that I have spent hundreds of hours each on.</li>
  <li>I have hundreds of interests that I have spent dozens of hours each on.</li>
</ul>

<h1 id="insightful--inciting-post">Insightful &amp; Inciting Post</h1>

<p>Anyway, the excellent Autistic advocate and author Nicole Filippone recently posted this on Bluesky:</p>

<blockquote class="bluesky-embed" data-bluesky-uri="at://did:plc:3eho774hjmrxs6pbnjfizsiv/app.bsky.feed.post/3lmg5xxfalc27" data-bluesky-cid="bafyreib46m6puikyoe7wogkjlsnmt5g6rf5d46w567ynjidxmoere3cnoi" data-bluesky-embed-color-mode="system">
    <p lang="en">The autistic experience of becoming an actual expert in your special interest, but having no formal education or qualifications to make a career out of it. And the autistic follow up experience of collecting expertise in various special interest areas and having no one to share the knowledge with 😆😅</p>
    &mdash; Nicole Filippone, Autistic Advocate &amp; Author (<a href="https://bsky.app/profile/did:plc:3eho774hjmrxs6pbnjfizsiv?ref_src=embed">@sensorystories.bsky.social</a>) <a href="https://bsky.app/profile/did:plc:3eho774hjmrxs6pbnjfizsiv/post/3lmg5xxfalc27?ref_src=embed">April 9, 2025 at 6:39 PM</a>
</blockquote>
<script async="" src="https://embed.bsky.app/static/embed.js" charset="utf-8"></script>

<p>And most Autistic people would probably agree. But I have some nuance I want to add here.</p>

<p>I am an expert in one of my special interests. And only one.
Perhaps obviously from the listing above, that is computer programming.</p>

<p>As mentioned above though, that is not the only area I have spent thousands of hours researching and picking up a substantial knowledge base about.
Why I am not an expert in physics, chemistry, electrical engineering, or writing thrilling episodes of Doctor Who?</p>

<h1 id="deliberate-practice">Deliberate Practice</h1>

<p>In Malcolm Gladwell’s book <a href="https://en.wikipedia.org/wiki/Outliers_(book)" target="_blank">Outliers: The Story of Success</a>, he talks about the concept of “deliberate practice”, which I would summarize as: focus, feedback, and frequency.</p>

<p>This is the main difference between knowing a lot about a topic and expertise:</p>
<ul>
  <li>You actually go do something with the knowledge.</li>
  <li>You fail, and find out how little you actually know.</li>
  <li>Then you try again, and again, and again, improving each time.</li>
</ul>

<h1 id="it-is-hard">It is hard</h1>

<p>It is <em>so</em> easy to be “that guy” (explicitly gendered because sadly it is frequently us guys…) on a topic with all the “well actually…” interjections showing off how very clever you are.</p>

<p>It is much harder to consider and weigh pros and cons to various approaches, to know how (and when!) to communicate complex subjects to non-experts in approachable but not condescending ways.</p>

<p>It is hard to be an expert, and that difficulty is the hard-won result of years of effortful, deliberate practice, not mere knowledge.</p>

<h1 id="it-is-worth-it">It is worth it</h1>

<p>But in a world of brittle fakers, it is worth being a solid expert. Society needs more of us.</p>

<p>So if you are Autistic and feel like taking on a challenge, turn one of your “special interests” into true expertise.</p>

<p>And a decade or so from now, let me know how it went.</p>

<p>Be proud of your progress, even if it was less than you expected.</p>

<p>It is always worthwhile.</p>

<hr />
<p><br /></p>

<p>For more reading on the topic of Autism: <a href="/topics/autism">click here</a></p>]]></content><author><name>Christopher Coleman</name></author><category term="autism" /><summary type="html"><![CDATA[As I have discussed previously, an important part of Autism is “Special Interests”. Most Autistic people have at least one topic they have devoted many thousands of hours of their life to and have an encyclopedic knowledge of. Some Autistic people have several of these, and if you also have ADHD (aka AuDHD, like myself) you may have hundreds.]]></summary></entry><entry><title type="html">If you’re happy and you know it: Flap your Hands!</title><link href="https://mellowfish.blog/autism/awareness/2025/04/01/flap-your-hands" rel="alternate" type="text/html" title="If you’re happy and you know it: Flap your Hands!" /><published>2025-04-01T07:01:01-05:00</published><updated>2025-04-01T07:01:01-05:00</updated><id>https://mellowfish.blog/autism/awareness/2025/04/01/flap-your-hands</id><content type="html" xml:base="https://mellowfish.blog/autism/awareness/2025/04/01/flap-your-hands"><![CDATA[<p>Time for another Autism Awareness/Acceptance month!</p>

<p>To celebrate, I want to talk about my experiences as an Autistic (and ADHD) person.</p>

<p>Lately, I have been leaning into managing my senory environment while also trying to enjoy life as much as possible.</p>

<p>An example of this has been wearing ear plugs and sunglasses during the worship service at church.
This has helped me not to get overwhelmed as quickly, though I still often went mute by the last couple songs.</p>

<p>Recently I discovered that I could fix that last little bit of overstimulation by letting myself flap my hands.
Yes, really. Hence, the joke title. But also, I own a shirt with that catchphrase: because of course I do.</p>

<p>I have been slowly working on giving myself permission to stim like this over the last 3 years since finding out I am Autistic, but it is <strong>so hard</strong> to fight against a lifetime of masking.
No one wants to draw attention to themselves.
Especially if you have been bullied as a kid.
But if you are disabled, you need to do what you need to do for better quality of life.</p>

<p>What would I rather do, get weird looks while I actually finish the service still singing, or be forced to go quiet partway through because I didn’t want to draw attention?</p>

<p>It has been super nice the last couple of weeks to make it all the way through the service without losing my ability to speak &amp; sing.</p>

<p>Similarly, I have been leaning hard into wearing my noise-cancelling headphones more often, especially when shopping or in a crowd.</p>

<p>I look absolutely ridiculous with dark sunglasses and chunky headphones, and I know it.
But I <strong>feel</strong> so much better.
And that matters, because I am a husband and father and need to be available for my wife and son vs spending all my time recovering from overstimulation after our weekly shopping trip.</p>

<p>Don’t get me wrong, I do still frequently have to take breaks to recover from overstimulation.
But with the right preparation, these sessions are less frequent and shorter duration, allowing me to enjoy my family time more.</p>

<p>It is a weird feeling though.
In many ways, I feel more disabled now than I did three years ago.
But it is because I am finally realizing just how much work “normal” life takes.</p>

<p>I feel more confident, more free, more settled in my own skin.</p>

<p>I feel more alien than ever, and I have always felt like I didn’t belong in any group I have been a part of.</p>

<p>I feel grateful for the support of my wife and the acceptance of my friends.</p>

<p>I feel tired just thinking about the next week with family in town and a birthday party for my almost 4 year old.</p>

<p>I feel happy. Time to flap my hands.</p>

<hr />

<p><br />
For more reading on the topic of Autism: <a href="/topics/autism">click here</a></p>]]></content><author><name>Christopher Coleman</name></author><category term="autism" /><category term="awareness" /><summary type="html"><![CDATA[Time for another Autism Awareness/Acceptance month!]]></summary></entry><entry><title type="html">Autism Acceptance (2025)</title><link href="https://mellowfish.blog/autism/awareness/2025/04/01/autism-acceptance" rel="alternate" type="text/html" title="Autism Acceptance (2025)" /><published>2025-04-01T00:00:00-05:00</published><updated>2025-04-01T00:00:00-05:00</updated><id>https://mellowfish.blog/autism/awareness/2025/04/01/autism-acceptance</id><content type="html" xml:base="https://mellowfish.blog/autism/awareness/2025/04/01/autism-acceptance"><![CDATA[<p>In June of 2022, I discovered I was <a href="/autism/2022/10/30/not-just-weird">not just weird</a> but <a href="https://bsky.app/hashtag/actuallyautistic" target="_blank"><code class="language-plaintext highlighter-rouge">#ActuallyAutistic</code></a>.</p>

<p>The last couple of Aprils I have written a series of articles about my journey of self discovery.</p>

<p>Notable events in the last year: I was offically diagnosed with both <a href="/autism/awareness/2024/05/28/my-first-neurodivergent-diagnosis">ADHD</a> and <a href="/autism/awareness/2024/10/29/my-autism-diagnosis">Autism</a>, so I am now clinically, officially, weird.</p>

<p>This Year’s Articles (will be updated throughout the month):</p>

<ul>
  <li><a href="/autism/awareness/2025/04/01/flap-your-hands">If you’re happy and you know it: Flap your Hands</a></li>
  <li><a href="/autism/2025/04/09/special-interests-vs-expertise">Special Interest(s) vs Expertise</a></li>
</ul>

<hr />
<p><br /></p>

<p>For more reading on the topic of Autism: <a href="/topics/autism">click here</a><br />
For more reading on the topic of ADHD: <a href="/topics/adhd">click here</a></p>

<hr />
<p><br />
Other years:</p>
<ul>
  <li><a href="/autism/awareness/2023/03/29/autism-awareness">2023</a></li>
  <li><a href="/autism/awareness/2024/04/01/autism-acceptance">2024</a></li>
</ul>]]></content><author><name>Christopher Coleman</name></author><category term="autism" /><category term="awareness" /><summary type="html"><![CDATA[In June of 2022, I discovered I was not just weird but #ActuallyAutistic.]]></summary></entry><entry><title type="html">Goodbye, Prius</title><link href="https://mellowfish.blog/general/life/2025/01/20/goodbye-prius" rel="alternate" type="text/html" title="Goodbye, Prius" /><published>2025-01-20T10:00:01-06:00</published><updated>2025-01-20T10:00:01-06:00</updated><id>https://mellowfish.blog/general/life/2025/01/20/goodbye-prius</id><content type="html" xml:base="https://mellowfish.blog/general/life/2025/01/20/goodbye-prius"><![CDATA[<p>A week and a half ago I got in my first car accident as an adult.</p>

<p><img src="/assets/images/2010_toyota_prius_accident_closeup.jpg" alt="2010_toyota_prius_accident_closeup.jpg" /></p>

<p>A car traveling in the opposite direction turned left into my front tire/door frame, and then I scraped along their front-end before coming to a stop.
The driver was an undocumented immigrant and eventually fled the scene when I called the cops to file a report.
The police were apparently super busy that night and took just over <strong>three hours</strong> to show up.</p>

<p>My door frame was bent enough to keep the door from fully opening, but it felt like mostly cosmetic damage, so I was shocked when insurance totalled it after just sending in preliminary photos.
Luckily, I have good insurance which covers uninsured motorists like this, so I got a good payout, and I then also received generous gifts from both my parents and my in-laws.</p>

<p>So today, we said goodbye to my 2010 Toyota Prius I bought back in November 2009, just over 15 years ago.</p>

<p><img src="/assets/images/2010_toyota_prius_last_shot.jpg" alt="2010_toyota_prius_last_shot.jpg" /></p>

<p>Then… I upgraded to a 2018 Kia Soul.</p>

<p><img src="/assets/images/2018_kia_soul_at_dealership.jpg" alt="2018_kia_soul_at_dealership.jpg" /></p>

<p>It was a weird feeling when I came home from the dealership and the Prius had already been towed to the junkyard (only 2 hours after I released it to them).</p>

<p>It has been a hard couple weeks as I recovered from the shock from the accident and then additional shock from the insurance decision to total.</p>

<p>I have grieved my Prius more than I thought I would (real tears!), though maybe I shouldn’t have been too surprised.</p>

<p>It was a good car, and had served me well with not a ton of stress (though lately a fair bit of burning oil).</p>

<p>It has seen me through my whole post-college life up until now, across 3 jobs and 2 states.<br />
It was the car my (then) girlfriend, my parents, and I took to Washington, DC in 2019.<br />
It was the car my (now) wife and I drove away from the church in 2020.<br />
It was the car we brought my son home from the hospital in 2021 (this quick sequence of life events is why I didn’t blog much for a bit!).</p>

<p>Goodbye, Prius.</p>

<p>Thanks for all the miles (178k), all the smiles, and all the memories over the last 15 years.</p>

<p>On to the next adventure…</p>

<hr />

<p><br /></p>

<p>Incidentally, this is not the first damage I had on the Prius and not even the first time that front driver’s side got hit!
My sister backed into my car (which was parked across the street) as she came out of my parent’s driveway in 2013.</p>

<p>Siblings, man…</p>]]></content><author><name>Christopher Coleman</name></author><category term="general" /><category term="life" /><summary type="html"><![CDATA[A week and a half ago I got in my first car accident as an adult.]]></summary></entry><entry><title type="html">Leaning In</title><link href="https://mellowfish.blog/mental-health/2024/11/24/leaning-in" rel="alternate" type="text/html" title="Leaning In" /><published>2024-11-24T15:26:01-06:00</published><updated>2024-11-24T15:26:01-06:00</updated><id>https://mellowfish.blog/mental-health/2024/11/24/leaning-in</id><content type="html" xml:base="https://mellowfish.blog/mental-health/2024/11/24/leaning-in"><![CDATA[<p>It’s been a month with <a href="/mental-health/2024/10/28/a-quiet-mind">a quiet mind</a>.
So, how’s it going?</p>

<p>Well, yesterday, I went mute for half an hour.
I almost didn’t get to say good night to my son.</p>

<p>Don’t worry though, this morning, it was only about 15 minutes of silence.</p>

<p>What gives? Well, that is just what happens when my nervous system gets overwhelmed.</p>

<p>How do I get overwhelmed?
Like all good things it all starts with a good night of sleep.
You see I am chronically sleep deprived so a good night of sleep is somewhat of a shock to my system.
I end up feeling jittery and out of sorts on mornings after a good night of sleep.</p>

<p>First up is a trip to the barber for my son.
I wear my Loop earplugs because I know that this noisy environment will be an issue.
After only about 10 minutes, we are all back in the car.</p>

<p>Next we go grocery shopping.
This is an assault on both my visual and auditory senses.
Normally I would plan ahead and bring my Sony noise canceling headphones, but we had made a last minute change to shop now and try to hit a playground later in the day due to cold weather.
So back in go the Loops, and I keep my sunglasses on to help some with visual noise.
It’s a lot, but we get home and I feel it has gone ok.</p>

<p>After putting away groceries and eating some lunch, I head out again, this time with headphones in hand.
Now I am venturing forth to do some Christmas shopping.
I spend the next several hours walking around the mall and various other stores (mostly to no avail).
I notice as I do that I am extra “flappy” (stimming by flapping my hands and walking on my toes).</p>

<p>Then my son wakes up from his nap a bit late (because he got down late) and my wife and I meet back up at the mall so he can play indoors since it is now dark.
My headphones help, but eventually the mall is wears at one’s soul.
After a while, we decide to eat at the mall food court to give ourselves more time for his bath later.
Fed, we finally head home with my son in my car, both because he wanted to and to give my wife a well deserved break.</p>

<p>And he is tired, and complaining, and asking questions, and generally being 3.5 years old.
And about halfway home I suddenly realize… 
I can’t answer his most recent question. 
Or his next one. 
Or the dozen after that.</p>

<p>For the last 10 minutes of the drive home, I am completely mute.<br />
And for the next 5 minutes it takes to get inside and settled (after gesturing to my wife so she understood my predicament).<br />
And for the first 15 minutes while she is giving him a bath and I am laying on by bed in a dim room, trying to recover.<br />
Finally I get to the point where I can whisper, and a few minutes later (once bath time is done) I go into the room and hug my son and tell him goodnight and that I love him.</p>

<p>Then I go back and lay down for another 20 minutes slowly reviving, before I go downstairs with my wife for some wind-down time in front of the TV.
<br />
<br /></p>

<hr />

<p><br />
This morning, as is often the case, I have a shorter period of silence towards the end of worship. 
I usually miss being able to sing the last song or two before the sermon.
Church is just a busy place, and while I love my small group, socializing takes a lot out of me.</p>

<p>It always sneaks up on me, even when I know it is likely coming.
I just hit some invisible line in the sand and… that’s that.</p>

<p>I do what I can to cope. 
I wear the Flare ear inserts pretty much every waking hour to minimize the long-term drain of the sounds of daily life (and especially the white noise at work).
I wear the Loop ear plugs whenever I am around a PA system or a crowded room.
These are both on my keychain as my EDC (every day carry).</p>

<p>Most days, I also carry around a backpack mostly just so that I can pull out the Sony headphones whenever I need actual silence, especially when multiple people are talking near me, or when I go to lunch or to the store.</p>

<p>I have multiple sets of sunglasses in various locations for ease of access, plus some tinted glasses for work.
The only time I am not wearing some sort of filtering glass on my face is at home, where I often keep the lights a bit dimmer than my wife would prefer.</p>

<p>I have leaned into managing my sensory environment.
It is what brought me the peace I needed to reduce anxiety.
And that had been great (more on how in a moment).</p>

<p>But it is not <strong>enough</strong>.<br />
At the end of the day, I am still Autistic.<br />
I will probably always struggle with sensory overwhelm.</p>

<p>So I am leaning in to that knowledge too.
I will do what I can. 
I will accept that it may not always be enough.
Sometimes I won’t be able to talk.
Sometimes I will have to opt out of events I know will hurt more than help.
But I will do what I can, and live with the mess.</p>

<p>Life is worth living, even when messy.</p>

<p>And to not end on a down note: I <strong>have</strong> started to see benefits to the quiet mind, even if it didn’t solve all my problems.
Specifically, I have been able to be much more present with my son and wife and help out more with the housework.
My colleges have noticed that I smile more, and seem to have more energy (though that is possibly more to do with drinking caffeinated Diet Dr Pepper again).</p>

<p>It is enough to get on with, anyway.
<br />
<br /></p>

<hr />

<p><br />
For more reading on the topic of Autism: <a href="/topics/autism">click here</a></p>]]></content><author><name>Christopher Coleman</name></author><category term="mental-health" /><summary type="html"><![CDATA[It’s been a month with a quiet mind. So, how’s it going?]]></summary></entry><entry><title type="html">My Autism Diagnosis</title><link href="https://mellowfish.blog/autism/awareness/2024/10/29/my-autism-diagnosis" rel="alternate" type="text/html" title="My Autism Diagnosis" /><published>2024-10-29T16:51:01-05:00</published><updated>2024-10-29T16:51:01-05:00</updated><id>https://mellowfish.blog/autism/awareness/2024/10/29/my-autism-diagnosis</id><content type="html" xml:base="https://mellowfish.blog/autism/awareness/2024/10/29/my-autism-diagnosis"><![CDATA[<p>Today I went in for my <a href="/topics/autism">Autism</a> assessment.<br />
Two and a half hours and ~$1200 later, I left with an “Autism Spectrum Disorder, Level 1” diagnosis.</p>

<p>This was absolutely not a surprising result.<br />
In fact, I would have been surprised to receive any other diagnosis (or none).</p>

<p>I have known I am Autistic for a couple years now.<br />
I first wrote about it almost exactly 2 years ago in my post: <a href="/autism/2022/10/30/not-just-weird">“Not (Just) Weird”</a>.</p>

<p>It has been quite a wild ride, with <a href="/mental-health/2024/03/16/anxiety-depression-medication">anxiety, depression, &amp; medication woes</a>, and an <a href="/autism/awareness/2024/05/28/my-first-neurodivergent-diagnosis">earlier neurodivergent diagnosis of ADHD</a>.
The mix of <a href="/autism/awareness/2024/04/10/autism-adhd-messy-middle">Autism and ADHD</a> (known a AuDHD) is in many ways its own beast; with some aspects of each condition masked by the other and others amplified.</p>

<p>Along the way, I have learned how to better cope with <a href="/autism/awareness/2024/04/02/autism-anxiety-overwhelm#self-care--sensory-overstimulation">sensory overstimulation</a>.
It isn’t perfect, and I also experience what may be my <a href="/autism/awareness/2024/04/09/travel-worn">first meltdown</a> following a travel heavy vacation.</p>

<p>I have also just <a href="/autism/awareness/2023/03/29/autism-awareness">learned a lot</a> about Autism, and attempted to share this new knowledge, with often mixed results.</p>

<p>This diagnosis was just one more small step in my journey of self awareness and acceptance, but it was an important one.</p>

<hr />
<p><br /></p>
<blockquote>
  <p>NOTE: I feel it is important to say: self-identification as any flavor of neurodivergent is totally valid.</p>

  <p>I just felt the need to get this diagnosis for myself and for talking to those outside the ND community.</p>
</blockquote>]]></content><author><name>Christopher Coleman</name></author><category term="autism" /><category term="awareness" /><summary type="html"><![CDATA[Today I went in for my Autism assessment. Two and a half hours and ~$1200 later, I left with an “Autism Spectrum Disorder, Level 1” diagnosis.]]></summary></entry><entry><title type="html">A Quiet Mind</title><link href="https://mellowfish.blog/mental-health/2024/10/28/a-quiet-mind" rel="alternate" type="text/html" title="A Quiet Mind" /><published>2024-10-28T08:00:01-05:00</published><updated>2024-10-28T08:00:01-05:00</updated><id>https://mellowfish.blog/mental-health/2024/10/28/a-quiet-mind</id><content type="html" xml:base="https://mellowfish.blog/mental-health/2024/10/28/a-quiet-mind"><![CDATA[<p>Today, for the first time in almost 2 years, both my mind and <a href="https://en.wikipedia.org/wiki/Sympathetic_nervous_system" target="_blank">sympathetic nervous system</a> were quiet.</p>

<p>Last Saturday, I stopped taking the anxiety medication that I have been on for almost 1.5 years.
I had been decreasing the dosage in a couple steps over the last month.</p>

<p>The last week or so has been a slow adjustment period, with a some noticeable rebound stress/anxiety.</p>

<p>But today, it is quiet in my head. Or at least, there is no baseline hum of stress, and no tremor of adrenal response.</p>

<p>My <a href="/topics/adhd">ADHD</a> means it isn’t <strong>actually</strong> quiet for long, but the “room noise” in my head is different now.</p>

<p>It appears that <a href="/mental-health/2024/07/28/take-it-easy">taking it easy</a> actually helped.</p>

<p>It feels good.</p>

<hr />
<p><br />
For more reading on the topic of Mental Health: <a href="/topics/mental-health">click here</a></p>]]></content><author><name>Christopher Coleman</name></author><category term="mental-health" /><summary type="html"><![CDATA[Today, for the first time in almost 2 years, both my mind and sympathetic nervous system were quiet.]]></summary></entry><entry><title type="html">It’s Always the Database</title><link href="https://mellowfish.blog/ruby/prod-vs-tutorial/2024/10/22/its-always-the-database" rel="alternate" type="text/html" title="It’s Always the Database" /><published>2024-10-22T16:48:01-05:00</published><updated>2024-10-22T16:48:01-05:00</updated><id>https://mellowfish.blog/ruby/prod-vs-tutorial/2024/10/22/its-always-the-database</id><content type="html" xml:base="https://mellowfish.blog/ruby/prod-vs-tutorial/2024/10/22/its-always-the-database"><![CDATA[<p>Note: This was (unintentionally) part of the <a href="/series/prod-vs-tutorial">Production vs Tutorial Code Series</a>.</p>

<hr />

<h2 id="story-time">Story Time</h2>

<p>Today our website was a bit slow, caused (as usual) by an <code class="language-plaintext highlighter-rouge">N+1</code> query.<br /></p>

<p>Unfortunately, a version of this query runs on <strong>every single request</strong><br />
And a specific subset of users with an average <code class="language-plaintext highlighter-rouge">N</code> of <code class="language-plaintext highlighter-rouge">~60</code> started hitting our website with twice our normal load<br />
And the query in question was running in a separate rails microservice, against a separate database that apparently doesn’t appreciate a ton of quick small reads.</p>

<p>This caused that service’s response times to grow to 20x their normal levels.<br />
This caused our app’s response times to ratchet up to 10x our normal levels.<br />
This caused our requests to back up in our puma worker queues.<br />
This caused our health check requests to be considered failed due to timeouts.<br />
This caused our load balancer to cycle our various instances constantly.<br />
This caused additional load per instance, and longer request queues.<br /></p>

<p>Eventually, this subset of users went to lunch and our traffic died down enough to be manageable.<br />
Then they came back from lunch, and we were cycling again.</p>

<p>However, over lunch, I had found and patched the <code class="language-plaintext highlighter-rouge">N+1</code> query using ActiveRecord’s <a href="https://guides.rubyonrails.org/active_record_querying.html#preload" target="_blank"><code class="language-plaintext highlighter-rouge">preload</code></a> method.
So once that deployed (sadly almost 4 hours after the incident started) we went from cycling instances to normal response times under identical load conditions.</p>

<p>🎉</p>

<hr />

<h2 id="explanation">Explanation</h2>

<p><code class="language-plaintext highlighter-rouge">N+1</code> is a term for the kind of performance bottleneck you find when you do work on each item in a list.
The <code class="language-plaintext highlighter-rouge">1</code> is the work to get the list itself, and there are <code class="language-plaintext highlighter-rouge">N</code> items in the list, so you do <code class="language-plaintext highlighter-rouge">N+1</code> units of work (roughly).</p>

<p>Most often in websites, “work” looks like a DB query or API call.</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># controller</span>
<span class="k">def</span> <span class="nf">items</span>
  <span class="vi">@items</span> <span class="o">||=</span> <span class="no">Item</span><span class="p">.</span><span class="nf">all</span> <span class="c1"># Runs 1 query</span>
<span class="k">end</span>
</code></pre></div></div>

<div class="language-erb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;%# view %&gt;</span>
<span class="nt">&lt;ul&gt;</span>
  <span class="cp">&lt;%</span> <span class="n">items</span><span class="p">.</span><span class="nf">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">item</span><span class="o">|</span> <span class="cp">%&gt;</span>
    <span class="nt">&lt;li</span> <span class="na">id=</span><span class="s">"</span><span class="cp">&lt;%=</span> <span class="n">item</span><span class="p">.</span><span class="nf">id</span> <span class="cp">%&gt;</span><span class="s">"</span><span class="nt">&gt;</span>
      <span class="c">&lt;%# Runs 1 query per item (N total) %&gt;</span>
      <span class="cp">&lt;%=</span> <span class="n">item</span><span class="p">.</span><span class="nf">owner</span><span class="p">.</span><span class="nf">full_name</span> <span class="cp">%&gt;</span>
    <span class="nt">&lt;/li&gt;</span>
  <span class="cp">&lt;%</span> <span class="k">end</span> <span class="cp">%&gt;</span>
<span class="nt">&lt;/ul&gt;</span>
</code></pre></div></div>

<p>In this example, we do one query in the controller and then we iterate over the results in the view.
This looks safe enough, but <code class="language-plaintext highlighter-rouge">item.owner</code> is an association, so it triggers a new query for each item in the list.</p>

<p>The solution here is to use something like <code class="language-plaintext highlighter-rouge">preload</code> to load all the owners in a single query and cache the associations on the items.</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># controller</span>
<span class="k">def</span> <span class="nf">items</span>
  <span class="c1"># Runs 2 queries, one for items, and one for owners of those items</span>
  <span class="vi">@items</span> <span class="o">||=</span> <span class="no">Item</span><span class="p">.</span><span class="nf">all</span><span class="p">.</span><span class="nf">preload</span><span class="p">(</span><span class="ss">:owner</span><span class="p">)</span>
<span class="k">end</span>
</code></pre></div></div>

<h2 id="application">Application</h2>

<p>A common starting point when trying to figure out why a particular page is slow is to assume “it’s always the database” until proven wrong.
Look for loops, especially in your view code, and especially when you pull lots of data off items in that loop.</p>

<p>Especially bad is when you need to chain calls through multiple layers of associations:</p>
<div class="language-erb highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;%# view %&gt;</span>
<span class="nt">&lt;ul&gt;</span>
  <span class="cp">&lt;%</span> <span class="n">items</span><span class="p">.</span><span class="nf">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">item</span><span class="o">|</span> <span class="cp">%&gt;</span>
    <span class="nt">&lt;li</span> <span class="na">id=</span><span class="s">"</span><span class="cp">&lt;%=</span> <span class="n">item</span><span class="p">.</span><span class="nf">id</span> <span class="cp">%&gt;</span><span class="s">"</span><span class="nt">&gt;</span>
      <span class="cp">&lt;%=</span> <span class="n">item</span><span class="p">.</span><span class="nf">owner</span><span class="p">.</span><span class="nf">full_name</span> <span class="cp">%&gt;</span><span class="nt">&lt;br</span> <span class="nt">/&gt;</span> 
      From <span class="cp">&lt;%=</span> <span class="n">item</span><span class="p">.</span><span class="nf">owner</span><span class="p">.</span><span class="nf">address</span><span class="p">.</span><span class="nf">city</span> <span class="cp">%&gt;</span>, <span class="cp">&lt;%=</span> <span class="n">item</span><span class="p">.</span><span class="nf">owner</span><span class="p">.</span><span class="nf">address</span><span class="p">.</span><span class="nf">state_shortcode</span> <span class="cp">%&gt;</span>
    <span class="nt">&lt;/li&gt;</span>
  <span class="cp">&lt;%</span> <span class="k">end</span> <span class="cp">%&gt;</span>
<span class="nt">&lt;/ul&gt;</span>
</code></pre></div></div>

<p>But thankfully <code class="language-plaintext highlighter-rouge">preload</code> still handles this.</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">items</span>
  <span class="vi">@items</span> <span class="o">||=</span> <span class="no">Item</span><span class="p">.</span><span class="nf">all</span><span class="p">.</span><span class="nf">preload</span><span class="p">(</span><span class="ss">:owner</span><span class="p">).</span><span class="nf">preload</span><span class="p">(</span><span class="ss">owner: :address</span><span class="p">)</span>
<span class="k">end</span>
</code></pre></div></div>

<h2 id="tool-recommendation">Tool Recommendation</h2>

<p>You can use the <a href="https://github.com/flyerhzm/bullet" target="_blank">bullet</a> gem to help find your N+1 queries while running your code locally or in tests/pipelines.</p>

<p>This can be super useful in a codebase you are unfamiliar with or if you are new to performance optimization.</p>

<h2 id="caveat">Caveat</h2>

<p>It is important to point out… this was an exceptional case. 
Normally <code class="language-plaintext highlighter-rouge">N</code> has to be in the 1000s or you have to have deeply nested loops with many associations before you get slowdowns like we saw.</p>

<p>With an <code class="language-plaintext highlighter-rouge">N</code> less than 100, I never would have dreamed there would be an issue.
But as soon as that query fix went out, even though the traffic actually continued increasing for a while, we had zero issues.</p>

<p>This is why good practices are important.
You never know when or how the stars will align and reveal performance bottlenecks.</p>]]></content><author><name>Christopher Coleman</name></author><category term="ruby" /><category term="prod-vs-tutorial" /><summary type="html"><![CDATA[Note: This was (unintentionally) part of the Production vs Tutorial Code Series.]]></summary></entry><entry><title type="html">Take It Easy</title><link href="https://mellowfish.blog/mental-health/2024/07/28/take-it-easy" rel="alternate" type="text/html" title="Take It Easy" /><published>2024-07-28T15:26:01-05:00</published><updated>2024-07-28T15:26:01-05:00</updated><id>https://mellowfish.blog/mental-health/2024/07/28/take-it-easy</id><content type="html" xml:base="https://mellowfish.blog/mental-health/2024/07/28/take-it-easy"><![CDATA[<p>Originally posted as <a href="https://twitter.com/mellowfish/status/1817161436839203084" target="_blank">a Twitter thread</a> yesterday in response to <a href="https://twitter.com/theBrianaMills/status/1816511108603359559" target="_blank">the following post</a>:</p>
<blockquote>
  <p>I wish more people understood that if you don’t stop and slow down when you need to, your body is eventually going to force you to slow down, and it might not let you go back to how you were before.</p>

  <p>- Briana Mills (<a href="https://twitter.com/theBrianaMills" target="_blank">@theBrianaMills</a>)</p>
</blockquote>

<hr />

<p><br />
In my early twenties I was blazing fast at logical puzzles and coding.
I loved my work and often worked overtime just because it was better than sitting home alone.
I was <a href="/autism/2022/10/30/not-just-weird">undiagnosed</a> and hit <a href="/topics/autism">#autistic</a> <a href="/topics/mental-health">#burnout</a> at least twice that I can identify now.</p>

<p>Then I got migraines.</p>

<p>It took a little over a year to reach the new normal with medication, and until then it was every other day, mild (for a migraine) but persistent.
I got an MRI of my brain at some point early on during that process and the doctor pointed out the half dozen dark spots on it.</p>

<p>Each one, he told me, was the result of a series of migraines, or possibly one or two bad ones.
They were places where a cluster of neurons literally burned themselves out, causing all the pain and other symptoms I felt.</p>

<p>Given that was early on, there are closer to a dozen now.</p>

<p>A dozen little dark spots in my brain where no activity happens anymore.</p>

<p>When I came out from under the migraines, I was… different.
It took a while to really understand how and how much, but I was slower.
All the same skills and knowledge and drive, but everything took longer.</p>

<p>I started from a higher bar than many, and am aided by my #autistic special interests and processing differences, so it is hard for other people to tell.</p>

<p>But I can tell.</p>

<p>Even ten years later, I can feel how much slower my brain works.
It affects me every minute of my working day.</p>

<p>I don’t know if I could have prevented this by slowing down in that first job.
But I didn’t, and it happened.
And all I can say is:</p>

<blockquote>
  <p>Take it easy.</p>
</blockquote>

<p>Don’t push yourself.
Have a balanced life, and plan for the long game rather than quick wins.
Because the consequences are real.</p>

<hr />

<p><br />
For more reading on the topic of Mental Health: <a href="/topics/mental-health">click here</a>
<br /></p>

<hr />

<p><br />
Interesting pattern I just noticed:</p>

<p>This is the third month in a row I posted on the 28th, and second month in a row that was my only post.</p>

<blockquote>
  <p>Take it easy.</p>
</blockquote>]]></content><author><name>Christopher Coleman</name></author><category term="mental-health" /><summary type="html"><![CDATA[Originally posted as a Twitter thread yesterday in response to the following post: I wish more people understood that if you don’t stop and slow down when you need to, your body is eventually going to force you to slow down, and it might not let you go back to how you were before. - Briana Mills (@theBrianaMills)]]></summary></entry><entry><title type="html">Autism: Unfiltered</title><link href="https://mellowfish.blog/autism/2024/06/28/autism-unfiltered" rel="alternate" type="text/html" title="Autism: Unfiltered" /><published>2024-06-28T14:00:01-05:00</published><updated>2024-06-28T14:00:01-05:00</updated><id>https://mellowfish.blog/autism/2024/06/28/autism-unfiltered</id><content type="html" xml:base="https://mellowfish.blog/autism/2024/06/28/autism-unfiltered"><![CDATA[<p>So, the last few days at lunch I have been taking my usual walks without anything in my ears (because I basically have Flares or Loops or AirPods in my hears all day every day).</p>

<p>And then yesterday I decided to also try not wearing my sunglasses to see what “raw IRL” experience was like.</p>

<p>And it was a bit overwhelming. I had been noticing the extra audio stuff, but adding in the visual noise was intense.</p>

<p>I hadn’t realized just how much I have been helping (?) myself out with multiple layers of filters on my senses at basically every moment.</p>

<p>What follows is a slightly cleaned up transcript of a Voice Recording I made while I was on this walk (very stream of conscious, which is not how I normally write).</p>

<h2 id="my-thoughts-as-i-walk-through-an-unfiltered-world">My thoughts as I walk through an unfiltered world:</h2>

<hr />
<p><br />
<code class="language-plaintext highlighter-rouge">Recording Starts</code></p>

<p>It’s interesting because a walk outside is a choice between either too much experience or enjoying the walk.</p>

<p>I usually have to focus on <strong>not</strong> seeing things, <strong>not</strong> hearing, filtering senses through sunglasses and headphones, and often listening to something distracting on the headphones, and not really <em>looking</em> at anything.</p>

<p>But obviously that’s hard to do all the time and probably not super healthy, so if I come out here with nothing in my ears and no sunglasses on then I get extreme sensory experiences:</p>

<p>If I allow myself to look (if I stop <strong>not</strong> looking) then..</p>

<p>I <strong>see everything</strong>:</p>
<ul>
  <li>I see all the cracks in the pavement individually.</li>
  <li>I see the ridges in the asphalt around, each piece of loose gravel on top of it.</li>
  <li>I see all the little bits of clover in the field, different leaves in the grass, every leaf on trees that I pass.</li>
</ul>

<p>If I allow myself to hear (if I stop <strong>not</strong> hearing) then..</p>

<p>I <strong>hear everything</strong>:</p>
<ul>
  <li>I can hear multiple different kinds of insects and sometimes different individuals of the same type.</li>
  <li>I can hear all the different birds around me.</li>
  <li>I can hear the wind, and the traffic, and can pick out individual cars and trucks in the traffic.</li>
</ul>

<p>On every step I <strong>constantly hear</strong>:</p>
<ul>
  <li>the gravel crunching under my feet</li>
  <li>the coins in my pocket shifting</li>
  <li>my anxiety medication clicking as moves around</li>
  <li>the little danging zipper pulls bumping against my lunch box</li>
</ul>

<p><strong>And I can’t shut out any of it.</strong></p>

<p>It’s either all or nothing.</p>

<p>So after only a few minutes I start to consider:</p>
<ul>
  <li>wearing headphones</li>
  <li>or putting in earplugs</li>
  <li>or putting on sunglasses</li>
  <li>or just disassociating a bit…</li>
</ul>

<p>I consider just saying “I’m not going to experience that sense right now” because the alternative is just <strong>fully immersive</strong>.</p>

<p>I don’t know if it’s exhausting or what.</p>

<p>It can be nice.</p>

<p>I feel very connected when I allow myself to experience the things.</p>

<p>It’s just not free: it takes quite a bit of energy.
So if I want to relax, and I want to just walk at lunch as exercise, I have to shut everything out.</p>

<p>And I legitimately don’t know which is the better option…</p>

<p><code class="language-plaintext highlighter-rouge">Recording Ends</code></p>

<hr />
<p><br /></p>

<p>A few clarifying comments after that recording…</p>

<p>This level of detail is unfortunately my (unfiltered) norm, not merely a result of over-sensitizing myself through lack of input.
If I do nothing to filter or distract my senses, I get this firehose of data through every sense.</p>

<p>After all these years I am… “used to” it? I guess? At least in small doses.</p>

<p>But I am also <strong>very</strong> used to (from early childhood!):</p>
<ul>
  <li>slightly unfocusing my eyes so I can take a break from “seeing” things</li>
  <li>always listening to something to distract my hearing</li>
  <li>getting so lost in a book that the whole world falls away and I forget to eat/pee much less hear everything happening around me</li>
  <li>when all else fails: simply <strong>dissociating</strong> (retreating from the world into either my mind/imagination or numbness)</li>
</ul>

<p>Since finding out I am Autistic a couple years ago and working with a therapist for the last year and a half, I have drastically upgraded my life with sensory filters.</p>

<p>My EDC (Every Day Carry) now includes:</p>
<ul>
  <li><a href="https://www.flareaudio.com/en-us/collections/calmer">Flare Audio: Calmer</a> ear filters</li>
  <li><a href="https://us.loopearplugs.com/products/quiet">Loop: Quiet</a> ear plugs</li>
  <li>Sunglasses (recently got my first pair of <a href="https://goodr.com/products/operation-blackout">Goodr</a>, but anything polarized &amp; UV blocking works)</li>
  <li>(at work) Lightly tinted but non-polarized glasses (too heavy of a tint or polarization bothers me while on the computer all day)</li>
</ul>

<p><br /></p>

<hr />
<p><br /></p>

<p>For more reading on the topic of Autism: <a href="/topics/autism">click here</a></p>]]></content><author><name>Christopher Coleman</name></author><category term="autism" /><summary type="html"><![CDATA[So, the last few days at lunch I have been taking my usual walks without anything in my ears (because I basically have Flares or Loops or AirPods in my hears all day every day).]]></summary></entry></feed>