mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
7b73e2824b
`futures_lite::AsyncReadExt::read_to_string` (that we use in `RealFs::load`) explicitly does not allocate memory for String contents up front, which leads to excessive reallocations. That reallocation time is a significant contributor to the time we spend loading files (esp large ones). For example, out of ~1s that it takes to open up a 650Mb ASCII buffer on my machine (after changes related to fingerprinting from #9007), 350ms is spent in `RealFs::load`. This change slashes that figure to ~110ms, which is still *a lot*. About 60ms out of 110ms remaining is spent zeroing memory. Sadly, `AsyncReadExt` API forces us to zero a buffer we're reading into (whether it's via read_to_string or read_exact), but at the very least this commit alleviates unnecessary reallocations. We could probably use something like [simdutf8](https://docs.rs/simdutf8/latest/simdutf8/) to speed up UTF8 validation in this method as well, though that takes only about ~18ms out of 110ms, so while it is significant, I've left that out for now. Memory zeroing is a bigger problem at this point. Before: ![image](https://github.com/zed-industries/zed/assets/24362066/5e53c004-8a02-47db-bc75-04cb4113a6bc) After: ![image](https://github.com/zed-industries/zed/assets/24362066/00099032-d647-4683-b290-eaeb969cac4a) /cc @as-cii Release Notes: - Improved performance when loading large files. |
||
---|---|---|
.cargo | ||
.config | ||
.github | ||
.zed | ||
assets | ||
crates | ||
docs | ||
extensions/gleam | ||
script | ||
tooling/xtask | ||
.dockerignore | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.mailmap | ||
Cargo.lock | ||
Cargo.toml | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
debug.plist | ||
docker-compose.sql | ||
docker-compose.yml | ||
Dockerfile | ||
LICENSE-AGPL | ||
LICENSE-APACHE | ||
LICENSE-GPL | ||
livekit.yaml | ||
Procfile | ||
README.md | ||
rust-toolchain.toml | ||
typos.toml |
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
You can download Zed today for macOS (v10.15+).
Support for additional platforms is on our roadmap:
- Linux (tracking issue)
- Windows (tracking issue)
- Web (tracking issue)
For macOS users, you can also install Zed from Homebrew:
brew install zed
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.
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 specified
error for a crate you've created? If so, addpublish = false
under[package]
in your crate's Cargo.toml. - Is the error
failed to satisfy license requirements
for 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 theaccepted
array inscript/licenses/zed-licenses.toml
. - Is
cargo-about
unable 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.