4fa75a78b99377d630d53e5d62be515f935a4ecf
TL;DR: Another O(n^2) strikes. In #19194 we received a report about a 7Mb JSON file that Zed struggles with. Naturally this file showcased a O(n^2) in line layout; this file has one long line. During line layout for Mac we have to convert between UTF-16 and UTF-8 indices in the string, as CoreText works with UTF-16 and Rust strings are UTF-8. The problem stemmed from the fact that we were re-seeking our string converter on each glyph, which boils down to: we were reparsing [0..curr_string_position] bytes up to full length of the string, which is the O(n^2) in question. This PR changes this behaviour to reuse the Index Converter if the position we're seeking to is not yet reached. Basically, we're treating the converter as forward iterator and we try to seek with the same iterator, if possible. Where previously you could not even open the file in OP (within reasonable time frame, I waited for 40 seconds before giving up), now you can do it in.. slightly over a second. The best part is: the experience is still not ideal. Typing in the buffer is sluggish. Still, this is a start. Release Notes: - Mac: Improved performance with very long lines
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS and Linux you can download Zed directly or install Zed via your local package manager.
Other platforms are not yet available:
- Windows (tracking issue)
- Web (tracking issue)
Developing Zed
- Building Zed for macOS
- Building Zed for Linux
- Building Zed for Windows
- Running Collaboration Locally
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Description
GPUI – Community Edition maintained by Oak Team
https://gpui-ce.github.io/
257 MiB
Languages
Rust
95.5%
WGSL
1.2%
Metal
1.1%
HLSL
1.1%
Python
0.7%
Other
0.3%