[docs-infra] Fix light/dark mode & RTL change speed regressionΒ #44534
Description
Steps to reproduce
The light/dark mode and RTL toggle is today x4 slower? than what good enough is at in production, and the RTL/LTR toggle in dev mode is x5-50 slower than what good enough is at? It used to be ok-ish:
v4.12.4 - Dev: mode ~600ms, RTL: ~600ms, Prod: mode and RTL ~150ms
v5.0.6 - Dev: mode ~1,369ms, RTL, ~10,865ms, Prod: mode and RTL ~200ms
v6.1.8 - Dev: mode ~2,253ms, RTL ~ 59,761ms, Prod: mode and RTL ~800ms
Material UI doesn't feel like a credible option for developers with this performance.
Context
Same problem as #41117. Material UI is not usable like this, not truly. I mean, as a developer, this reinforces this story: I would only adopt Material UI for a new React project so that I can then contribute a fix to this. Otherwise, I wouldn't want to touch Material UI, there are better options out there nowadays, and it would only make sense to use the rich components of MUI anytime I can't find anything better.
Your environment
npx @mui/envinfo
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
cc @romgrk as related to performance on styled engine.