A Broken Heart: Getting a 100x speedup by changing one dumb line of code

https://allenpike.com/2026/a-broken-heart/

A Broken Heart

Or, getting a 100x speedup with one dumb line of code.

Allen Pike

@apike I’m not sure anyone knows how truly meta your last blog post is. Working on an app today and it TOTALLY borked my layout code trying to load it.

To fix it, I fed Claude YOUR article ABOUT how to render your article.

Well played, sir. Well played, indeed.

@cheesemaker Haha, what? Like your app couldn’t render my article, so you asked Claude to use the techniques in that article to debug the app? 🤯

@apike yep! We live in crazy times. This was Claude’s response:
“Oh wow! This is perfect - the article is literally ABOUT this exact bug! The RSS feed content must include that broken minimal
 reproduction HTML which sets font-family: “Noto Color Emoji” - and that’s what’s causing the slow rendering and weird spacing in our
 WebView!

 The solution is to strip out or override any font-family declarations that reference Noto Color Emoji”

@apike hi there! Just seeing the network requests I'm pretty sure it's a bug that the response is 4MB for a subsetted font and the full font is 40MB in woff2 format.
Opening in ttx I see a bunch of glyph code duplication in the svg table.
I'll keep you updated about a fix :) thanks for bringing it up
@tom Interesting to hear, thanks Tom!
@apike should be now fixed 🙂 (no more crashes on iOS Safari)
@tom Interesting! I'm still seeing 1600ms main-thread-blocking Layout to display a single Noto Color Emoji heart in desktop Safari (26.3). Is that expected?
@apike oh sorry I didn't test the internals. I verified the specimen page for Noto Color Emoji doesn't crash anymore. Fonts was sending ~40mb of woff (uncompressed to 100+) and now it's about 3.5mb of woff.
@apike this is how it should look after the fix. I may have a early access to a version that is not yet the public production version.
@tom Yeah looks like it's not live yet – cool to see progress on this!
@apike Thanks for the interesting post. Have you tried the 🧺 emoji? When we were working on COLRv1 in Chrome, I was looking for a test glyph and found this one to be the heaviest in drawing operations. I wonder what the layout time for 🧺 is.
@drott Interesting – weirdly in my own test 🧺 and 🫠 do not trigger the bug at all, laying out in 0.2ms whereas ❤️ and 🤯 take about 1550ms. It seems there's a technique used in the heart glyph that triggers a bad path in Safari that not all glyphs use.
@apike I really like this. (Well not bugs, I hate bugs) but when you go down the rabbit hole and find what's causing the bug and are able to fix it, or at least report it to the ones who can fix it