Follow-up to #57772. While comparing the `edit_file_tool_streaming/medium_insertions` benchmark in Criterion and xctrace, I noticed the DP scoring loop was spending most of its time on inlined `Matrix::get`/`Matrix::set` access in `StreamingDiff::push_new`. This changes the loop to split the previous and current score columns once per DP column and then index those column slices directly. This keeps the scoring algorithm the same, but hoists the column offset calculation out of the inner loop and gives the compiler clearer aliasing information between the immutable previous column and mutable current column. In xctrace, the hottest DP scoring line dropped from 10,407 samples before to 9,409 samples after on `edit_file_tool_streaming/medium_insertions`, and total `StreamingDiff::push_new` leaf samples dropped from 10,800 to 9,822. This is consistently faster in the end-to-end `edit_file_tool` benchmark, and gives a small speed-up for the targeted workload without changing the scoring algorithm. ### Results Benchmarked with `release-fast` against a clean baseline using Criterion’s `before_slice` baseline. #### `streaming_diff_push_new` | Fixture | Before median | After median | Change | | --- | ---: | ---: | ---: | | `tiny_function_rewrite` | `7.6317 ms` | `6.4951 ms` | 10.8% faster | | `small_function_rewrite` | `45.961 ms` | `44.839 ms` | No significant change | | `medium_many_small_changes` | `99.694 ms` | `104.83 ms` | 5.2% slower | | `medium_insertions` | `95.909 ms` | `83.093 ms` | 13.5% faster | #### `edit_file_tool_streaming` | Fixture | Before median | After median | Change | | --- | ---: | ---: | ---: | | `tiny_function_rewrite` | `1.1110 ms` | `1.0617 ms` | 7.1% faster | | `small_function_rewrite` | `2.4554 ms` | `2.2751 ms` | 7.1% faster | | `medium_many_small_changes` | `87.272 ms` | `77.065 ms` | 11.5% faster | | `medium_insertions` | `92.469 ms` | `87.478 ms` | 5.9% faster | The lower-level `streaming_diff_push_new` benchmark is mixed, but the end-to-end `edit_file_tool_streaming` workload improves across all fixtures. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A or Added/Fixed/Improved ... |
||
|---|---|---|
| .agents/skills/gpui-test | ||
| .cargo | ||
| .cloudflare | ||
| .config | ||
| .factory | ||
| .github | ||
| .zed | ||
| assets | ||
| ci | ||
| crates | ||
| docs | ||
| extensions | ||
| legal | ||
| nix | ||
| script | ||
| tooling | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| .prettierrc | ||
| .rules | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| clippy.toml | ||
| CODE_OF_CONDUCT.md | ||
| compose.yml | ||
| CONTRIBUTING.md | ||
| debug.plist | ||
| default.nix | ||
| Dockerfile-collab | ||
| Dockerfile-collab.dockerignore | ||
| Dockerfile-cross.dockerignore | ||
| Dockerfile-distros | ||
| Dockerfile-distros.dockerignore | ||
| flake.lock | ||
| flake.nix | ||
| GEMINI.md | ||
| LICENSE-AGPL | ||
| LICENSE-APACHE | ||
| LICENSE-GPL | ||
| livekit.yaml | ||
| lychee.toml | ||
| Procfile | ||
| Procfile.all | ||
| Procfile.web | ||
| README.md | ||
| renovate.json | ||
| REVIEWERS.conl | ||
| rust-toolchain.toml | ||
| rustfmt.toml | ||
| shell.nix | ||
| typos.toml | ||
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking discussion)
Developing Zed
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.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.