website icon indicating copy to clipboard operation
website copied to clipboard

Components latency on radix-ui.com

Open inwardmovement opened this issue 3 years ago • 5 comments

Bug report

There is a latency on radix-ui.com, but not in codesandbox.io. To reproduce, just compare the dropdown menu between radix-ui.com and the codesandbox example:

radix-latency

Your environment

Chrome 103.0.5060.134 (64 bits) Windows 10 21H1 (19043.1826) (also tested on Chromebook, and with Firefox, same latency)

inwardmovement avatar Jul 24 '22 07:07 inwardmovement

I'm unable to reproduce on MacOS or virtualised windows. I'll leave this open for now pending time in the future to investigate further.

andy-hook avatar Jul 25 '22 12:07 andy-hook

I noticed there is no latency on the homepage with the "Options" dropdown example.

What are the differences between this dropdown and the one on the Dropdown Menu page, that could cause this difference in latency?

inwardmovement avatar Jul 27 '22 06:07 inwardmovement

What are the differences between this dropdown and the one on the Dropdown Menu page, that could cause this difference in latency?

Hard to say without looking into it further, are you seeing the same in any of your projects?

andy-hook avatar Jul 27 '22 08:07 andy-hook

I'm not yet using Radix in a project, I'm considering using it and I spotted this 300ms latency while openning the dropdown menu on the dedicated doc page, on at least 2 different browsers and computers.

inwardmovement avatar Jul 27 '22 08:07 inwardmovement

I can reproduce it on the website only by turning on CPU throttling x6. The difference would be the size of the tree/general page layout and impact of a style recalculation.

You can see a couple of large style recalc:

CleanShot 2022-08-01 at 14 49 16@2x

You can probably largely ignore this as it's more dependent to the page you will end up having, possibly being able to use css containment, as the style recalc/reflows are more than likely unavoidable from our side.

benoitgrelard avatar Aug 01 '22 12:08 benoitgrelard