primitives icon indicating copy to clipboard operation
primitives copied to clipboard

Components (Dropdown, Dialog, etc) are too slow due to Passive effects.

Open hywook4 opened this issue 2 years ago • 5 comments

Hi

When the page size is big (many DOMs), components such as Dropdown/Dialog becomes very slow.

I've used React profiler to dive deep into this issue and found that it's due to long Passive effects.

Below is the screenshot of the profiler result Screen Shot 2023-08-22 at 5 16 07 PM

I've found that in the case of the Dropdown component, the issue was fixed when I gave modal={false} props.

Also seems like the "Presence" component is the main cause for the passive effects.

Thank you,

hywook4 avatar Aug 22 '23 08:08 hywook4

This is just a guess, but Presence key=".0" seems like the one causing the problem while I have no idea where it came from.

hywook4 avatar Aug 22 '23 10:08 hywook4

Does anyone have a patch for this? Radix SCREAMS in comparison with modal false but it has other unintended consequences.

recurrence avatar Dec 13 '23 00:12 recurrence

Anyone have any lead on this?

hariangr avatar Dec 22 '23 09:12 hariangr

This issue basically is the biggest flaw in this project at present, and no one has come forward to resolve it yet.

  • https://github.com/radix-ui/primitives/issues/1634
  • https://github.com/radix-ui/primitives/issues/2602
  • https://github.com/radix-ui/primitives/issues/2320
  • https://github.com/radix-ui/primitives/issues/2218

tangye1234 avatar Feb 01 '24 03:02 tangye1234

When modal is enabled, popover calls the react-remove-scroll component, which iterates through every element in the page, and when there are enough elements, there are performance issues.

But I don't know how to solve it.

taoliujun avatar Feb 22 '24 07:02 taoliujun

Let's concentrate on a single issue rather than have lots of duplicates for the same thing: #1634

benoitgrelard avatar Feb 27 '24 14:02 benoitgrelard

Let's concentrate on a single issue rather than have lots of duplicates for the same thing: #1634

How is the concentration going?

ibanlopez avatar Jul 02 '24 08:07 ibanlopez