Ivan Akulov
Ivan Akulov
@iamakulov.com
Web perf engineer @ Framer. Prev. web perf consultant (Google, Appsmith, Toggl, etc). Getting React interactions 2-4x faster. GDE. He/him 🏳️🌈
854 followers74 following120 posts
@storyhb.com hey :) i’m a staff performance engineer at Framer. i have a quick q about automatic image preloading in React 19. (hopefully you’re the right person as you merged github.com/react/react/... – if not, sorry, just lmk who’s the best person to ask this at 🙏)
the context is we at @framer.com have our own React framework for Framer sites. we care about perf a lot, so we inject our own smart <link rel="preload"> tags and fetchpriority hints. React’s automatic preloads mess with that, and it’s really annoying to strip them out of HTML stream :(
@storyhb.com hey :) i’m a staff performance engineer at Framer. i have a quick q about automatic image preloading in React 19. (hopefully you’re the right person as you merged github.com/react/react/... – if not, sorry, just lmk who’s the best person to ask this at 🙏)
> in *any* React app The critical element here is a top-level wheel event listener, which React always installs. The video above actually doesn’t use React at all, it only has that event listener installed Reported here: bugs.webkit.org/show_bug.cg...
Ivan Akulov reposted
If you throttle the network in DevTools you can't always trust the metrics. @iamakulov.com explains why in his new article. 3perf.com/blog/chrome-...
A few people around got recently confused by things being slow in DevTools but not in real life, so I explained why: 3perf.com/blog/chrome...
Ivan Akulov reposted
My Replay time-travel-based React+Redux perf reports experiments are coming together! Just nailed sourcemapped component + selector identities, and I've got accurate timing details on dispatches + renders from a Replay DevTools E2E recording! Early perf report example attached.
A week-ish later - it's working! Rebuilt my React+Redux dispatch+render perf POC on top of Replay's current infra. Currently extracting dispatch+render timings and selector calls . Just raw data atm, but now I can build meaningful visualizations / perf analysis with this! time travel's awesome!
Something I worked on (with a few other wonderful folks) for the past few weeks :) www.framer.com/llm
the chart that I feel perhaps the proudest of is this framer’s lcp (aka page loading time), across all sites, going lower and lower day by day, free for all framer customers lots of work by our infra/canvas teams, @kurtextrem.de, and yours truly <3
next.js (pages router) loads data for pages you navigate to, but never releases it, whoops: github.com/vercel/next...
3) In October, we rewrote our optimization stack – and made it so that on publish, only the most visited pages are optimized. Less popular ones would get lazily handled after the first visit. (H/t our Piotr Krawiec, who single-handedly did the whole rewrite: www.framer.com/updates/dyn...)
Turns out this is why! github.com/tc39/proposa...
Welp, turns out it’s not real. Just opening DevTools makes all timers 5-100× slower, due to the overhead of capturing stack traces. Even if you do nothing else (don’t record performance, etc)! Guess who accidentally spent a weekend optimizing this 😅 (h/t @paul.irish for explaining why)
Why are native setTimeout and clearTimeout calls so expensive? Like, here it takes 1.5 ms. What’s the technical reason it’s so slow? Just 100-200 of those in a row (trivial if you’re mounting a bunch of React components that set timers) will easily block the page.
Benchmark: codepen.io/iamakulov/pe.... Try with DevTools open vs closed – especially with call stack depth 1000. (“1000 levels deep” might seem like a lot, but it’s pretty realistic with React’s recursivelyTraversePassiveMountEffects. That’s how I ran into it – in TanStack Query!)
Okay, so this is pretty wild: apparently, in Chromium, the deeper you are in the call stack, the slower your `setTimeout()` calls become? gist.github.com/iamakulov/85...
Why are native setTimeout and clearTimeout calls so expensive? Like, here it takes 1.5 ms. What’s the technical reason it’s so slow? Just 100-200 of those in a row (trivial if you’re mounting a bunch of React components that set timers) will easily block the page.
Belated hi from @perfnow.nl! Come talk to us (me & @kurtextrem.de) about React performance, Framer sites, LCP/INP and more :D
Neat lil learning from today’s @perfnow.nl (via Umar Hansa): You can now throttle individual requests in Chrome! Neat for experimenting with stuff like - lazy-loading: does the UI look okay if this chunk takes MUCH longer to arrive - resilience: what happens if this specific CDN is extremely slow