Alex MacArthur
macarthur.me
Alex MacArthur
@macarthur.me
Bossing around computers in made-up languages.
I wrote about DNS resolution from the POV of a browser, and how you can fine-tune the process to squeeze out some performance points. Check it:

macarthur.me/posts/dns/
DNS Resolution Adds Up
DNS resolution is cheap, but it ain't free. In scenarios when it counts, the `dns-prefetch` resource hint could give you a nice, slight edge in the front-end performance game.
macarthur.me
November 11, 2025 at 5:47 PM
He’s right. This place will continue to lose if it keeps operating like this.
JD Vance just made an account on here and then was swiftly banned.

I am obviously no fan of the VP, but Bluesky will never experience the growth it needs if it instantly bans any dissenting voice, including the Vice President of the United States.

Feels like the wrong way to run things IMO.
June 18, 2025 at 10:21 PM
I’ve been spending some dedicated time tinkering w/ iterators, iterables, & generators in #JavaScript. I’m still struggling a bit to find use cases in which it’s materially the best solution. But! I am liking the ergonomics more.

Blog post:

macarthur.me/posts/genera...
I think the ergonomics of generators is growing on me.
I took a stab at getting more familiar with iterators, iterables, and generators. I think I'm starting to like the ergonomics.
macarthur.me
May 12, 2025 at 4:25 PM
Sickkk new feature coming to PicPerf: automatic resizing. Here's how it'll work:

- Behind the scenes, PP will headlessly render your page at a large desktop's screen dimensions.
April 15, 2025 at 12:19 AM
I learned about “forbidden” request headers recently, which can’t be overridden by client-side JavaScript APIs. A subset also give some nice context about a request, like whether it came from someone directly navigating to a page.

Useful stuff. Wrote more here:

macarthur.me/posts/forbid...
I guess some request headers are more trustworthy than others.
There's a subset of request headers that can't be modified by a spec-compliant user agent. Let's explore why they're useful for determining how and for what purpose a request was triggered.
macarthur.me
March 31, 2025 at 10:29 PM
I think we’re over-indexing on the importance of time-to-ship and the AI tooling that minimizes it. Shipping is easier, but committing to iterating on & growing a product is still hard. That’ll probably continue to be the differentiating factor between success & failure.
February 11, 2025 at 2:22 PM
TIL about “forbidden” request headers. None of these can be set in the browser by JavaScript APIs like fetch() or XMLHttpRequest.
February 10, 2025 at 3:14 PM
Reposted by Alex MacArthur
Good post from @macarthur.me on the various ways to break up long tasks.

macarthur.me/posts/long-t...

I especially like nice summary at the bottom:
February 8, 2025 at 12:12 PM
If you’ve ever needed to break up a long JavaScript task to keep the UI responsive, you’ve probably reached for setTimeout(). Turns out there are a boatload of other options at your disposal, like scheduler.yield(). I wrote about a handful & their tradeoffs:
February 3, 2025 at 1:58 PM
Look at what you'll soon be able to do in native CSS (currently supported in Chromium browsers):
January 25, 2025 at 4:36 PM
Short post about composing template literal types in TypeScript:

macarthur.me/posts/templa...
I didn't know you could compose template literal types in TypeScript.
TypeScript's string literal types are a lot more useful than I originally thought.
macarthur.me
January 18, 2025 at 5:55 AM
I wrote about using short-lived memoization bound to a single tick of the event loop in JavaScript. queueMicrotask() is awesome. Read:

macarthur.me/posts/memoiz...
Short-Lived, Tick-Bound Memoization in JavaScript
Sometimes, typical memoization function won't cut it when there are so many changing variables in play between ticks of the event loop. Let's explore how we might fine-tune it.
macarthur.me
January 14, 2025 at 3:41 PM
I blabbed a ton about forced DOM reflows, the event loop, and the browser’s repaint cycle, just to slide open a box with CSS transitions & JavaScript. Look:

macarthur.me/posts/box
Using Forced Reflows, the Event Loop, and the Repaint Cycle to Slide Open a Box
Triggering smooth, reliable CSS transitions with JavaScript can be weirdly more complicated than you expect. We're gonna explore it more.
macarthur.me
January 6, 2025 at 7:20 PM
Comment submissions for JamComments just got a big speed boost because I finally remembered to set Laravel’s QUEUE_CONNECTION to something other than “sync.” 🤦‍♂️
December 5, 2024 at 1:34 PM
I’ve been learning about content security policies and have reached the following conclusion:

They’re valuable even for simple blogs and very easy to set up. You should probably just get one.

macarthur.me/posts/csp
You Might As Well Use a Content Security Policy
Content Security Policies, even for simple, content-focused sites, offer good protection against rare but real vulnerabilities out there. You might as well just get one.
macarthur.me
December 2, 2024 at 6:28 PM
My first (personal) M series MacBook is coming this week. I’ve been doing all dev work on a 2015 MBP until now and I’m so ready to enter the future.
December 2, 2024 at 2:19 PM
Simple demo for embedding JamComments client-side:

- ~10 lines of code to configure
- no custom styles necessary
- ~2.6kb (gzipped) of JavaScript needed to load
- ~3.6kb of HTML to load lazily load in after that

And none of the grossness other comment tools throw in.

jamcomments.com/demo/vanilla
December 1, 2024 at 2:49 AM
My daughters are starting their first entrepreneurial endeavor. Introducing the Bin Buddies!

binbuddies.pro
Let the Bin Buddies roll out your bins for you!
We'll take out your trash & recycling bins for you every week, so you don't have to keep forgetting about it!
binbuddies.pro
November 30, 2024 at 12:00 AM
You can now embed comments on your website entirely client-side. Very similar to how some other services work, but with a waaaaaaaaaay smaller performance penalty and far less grossness.

jamcomments.com/docs/integra...
Vanilla JavaScript
jamcomments.com
November 29, 2024 at 9:12 PM
JamComments.com is about to become very CSP-friendly. And as a result, it’ll be very difficult to tell you’re using a third-party service, even by looking through the page source. 🥷
JamComments: A guilt-free comment service for your blog.
A blog comment service and Disqus alternative that won't leave you feeling like you missed a shower.
JamComments.com
November 24, 2024 at 12:20 AM
Crazy how we’ve all just forgotten about the fact that there’s a map on the back of the Declaration of Independence.
November 22, 2024 at 11:26 PM
What a friggin week. Never touching a database again.
November 22, 2024 at 11:20 PM
Small blog post on running a Chrome extension's content scripts in a way that won't cause a review delay:

picperf.io/posts/chrome...
Avoiding a "Host Permission" Review Delay When Publishing a Chrome Extension
Get a Chrome extension reviewed a smidge more quickly by more carefully executing its client-side scripts only when they're needed.
picperf.io
November 20, 2024 at 1:22 AM
Of course.
November 18, 2024 at 4:43 PM