Skip to content

Conversation

@sunli829
Copy link
Contributor

@sunli829 sunli829 commented Mar 20, 2025

Since TextLayout is not shared by multiple threads, changing it to Rc<RefCell<T>> should improve performance.

I also found several codes with the same problem. If you think this change is beneficial, I will continue to improve it in the subsequent PR. 🙂

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 20, 2025
@maxdeviant maxdeviant changed the title refactor: TextLayout to use Rc<RefCell> instead of Arc<Mutex> for improved performance Refactor TextLayout to use Rc<RefCell> instead of Arc<Mutex> for improved performance Mar 20, 2025
@Anthony-Eid
Copy link
Contributor

zed_ref_cell vs mutex

This is a benchmark I did of scrolling to line 1000 in editor.rs

@Anthony-Eid Anthony-Eid merged commit 1db621d into zed-industries:main Mar 21, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants