Slow Performance in Safari
See original GitHub issueIn Safari, Lexical performance becomes unacceptably slow in as little as ~400 characters in a plaintext document.
This this CodeSandbox as an example. In just a few hundred characters, the latency on my M1 MacBook Air makes the editor difficult to use.
This sandbox is using:
- Lexical 0.2.4
- React 18
I’ve been testing with this short document:
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
Issue Analytics
- State:
- Created a year ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Safari Running Slow on Mac? 8 Possible Causes and Fixes
Safari could be slow because you're using an outdated version of Safari. The cache might be overworked, or you might be facing network...
Read more >Safari has become very slow, lagging and not loading pages
Empty Caches. You can either choose Safari menu > Clear History Or, if you do not want to remove History go to Safari...
Read more >Safari Slow on iPhone and iPad? Here are 8 Solutions to Fix It
One reason Safari feels slow can be due to background tasks. Turning off automatic iOS updates and app updates might help. Secondly, disabling ......
Read more >Impeccable Tips to Speed Up Slow Safari on Mac
Why is Safari Slow? · Poor Internet connection · Several opened tabs · Safari history · Caches & cookies · AutoFill form text...
Read more >Why Is Safari So Slow? Top Fixes to Speed up Browsing!
Part 1. Why Is Safari So Slow on Mac and How to Fix It? · There are too much data and cache on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Makes sense! I wouldn’t expect Lexical to enforce any visual styling.
Nah—
outline: none
andoutline: 0
are equivalent, performance-wise, as far as I can tell. I also tested manual outlines withbox-shadow
andborder
, and they also perform fine. Looks likeoutline
is the only problematic one.I agree that a Webkit bug may be a good idea. I think it makes sense to let you all file it, though let me know if I can be of any more assistance isolating or reproducing the problem.
@trueadm Just to clarify, I haven’t done any testing in the Lexical Playground itself.
What I have found that is extremely surprising is that setting
outline: none
on the editor itself vastly improves performance in Safari. I whittled your CodeSandbox down to what I had in mine and eventually found that removing that CSS rule caused yours to inherit the same performance.To reproduce: Simply remove the
outline: 0
rule from the.editor-input
selector in your CodeSandbox, and then try editing a document with 500 empty lines. It’s a world of difference. I guess outlines are just really expensive to paint in Safari? Not sure.As far as I’m concerned, this issue is solved for me, but I’ll let you close the issue out or not depending on whether you want to take any action here.