---
title: "Discussion on \"The progress bar that made typing lag: debugging a 331 ms INP in a React game\" | Hashnode"
description: "Discussion on \"The progress bar that made typing lag: debugging a 331 ms INP in a React game\". A timer bar animating its width forced a layout on every keystroke in my React game. How I traced a 331 ms INP in Chrome DevTools and fixed it."
url: "https://hashnode.com/posts/the-progress-bar-that-made-typing-lag-debugging-a-331-ms-inp-in-a-react-game/6af731967d1a9aac85fbdebc"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The progress bar that made typing lag: debugging a 331 ms INP in a React game](https://museek.hashnode.dev/the-progress-bar-that-made-typing-lag-debugging-a-331-ms-inp-in-a-react-game?utm_source=hashnode&utm_medium=feed)

A timer bar animating its width forced a layout on every keystroke in my React game. How I traced a 331 ms INP in Chrome DevTools and fixed it.

5d ago · 8 min read · museek.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#web-performance](https://hashnode.com/tag/web-performance)
-   [#css](https://hashnode.com/tag/css)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Alex Xiao](https://hashnode.com/@xiao-web)

@xiao-web

  
[View profile](https://hashnode.com/@xiao-web)

## Responses 2

Markdown supported · ⌘↵ to post

[Alex Yu](https://hashnode.com/@alexyu)

[4d ago](https://hashnode.com/posts/the-progress-bar-that-made-typing-lag-debugging-a-331-ms-inp-in-a-react-game/6af731967d1a9aac85fbdebc/comment/6af8299f73e8e52437111a05)

Nice trace from the 290 ms Layout to the once-per-second width transition—the timing correlation makes the stutter explanation really clear. The clipped full-width bar with translateX is a neat way to keep rounded ends; did you compare it with scaleX plus transform-origin:left, or was preserving the cap shape the deciding factor?

[Alex Xiao](https://hashnode.com/@xiao-web)

[4d ago](https://hashnode.com/posts/the-progress-bar-that-made-typing-lag-debugging-a-331-ms-inp-in-a-react-game/6af731967d1a9aac85fbdebc/comment/6af8299f73e8e52437111a05#reply-6af830f746d71bc4055f2307)

Thanks! Performance-wise I didn’t benchmark them against each other, since scaleX and translateX are both compositor-only transforms, so neither triggers layout. The cap shape was the deciding factor: with scaleX + transform-origin: left, the border-radius gets scaled along with the bar, so when the bar is short the rounded ends get squashed. Translating a full-width bar inside an overflow-hidden container keeps the corners intact for free. If I ever needed scaleX, I think the usual workaround is to scale a plain inner element and draw the rounded caps separately, but the clipped version was simpler here.
