zed icon indicating copy to clipboard operation
zed copied to clipboard

Replacing a lot of entries is still extremely slow compared to other editors

Open maximeborges opened this issue 1 year ago • 0 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

When trying to replace a lot of tabs by semicolons in a CSV-like file, Zed basically froze for a few minutes (I killed it after 3 minutes). I was on 0.139.3, I checked the existing issues and saw that https://github.com/zed-industries/zed/issues/13455 (and even the file example from https://github.com/zed-industries/zed/issues/11210 takes tens of seconds just to load up) were fixed in 0.143.6, so I tried installing zed-preview-bin from AUR which currently is 0.144.2, but I don't really see much of an improvement.

Repro

You can generate a file with similar content to my test file with (210k matches):

for i in {1..30000}; do echo "$i\t$i\t$i\t$i\t$i\t$i\t$i\t$i" >> /tmp/test_file; done

Then in Zed, use the replace function with a tab char (either by pasting a tab char in the search field, or enabling regexp and using \t; both takes the same time on my machine) and use a semicolon in the replace field. This action takes about 45s, using 100% of a thread of my i7-1260p CPU. The same action takes less than half a second in VSCode, and is instantaneous in vim.

Environment

Zed: v0.144.2 (Zed Preview) OS: Linux Wayland manjaro unknown Memory: 31.1 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

maximeborges avatar Jul 13 '24 16:07 maximeborges