mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.94k stars 716 forks source link

:write-all doesn't write to the files in parallel #3636

Open L-as opened 4 years ago

L-as commented 4 years ago

Feature

When writing to many files mounted somewhere with high latency (e.g. over the network), the latency compounds even though :write-all should take almost exactly the same time as :write in high latency situations. A fix would be to write to each buffer in parallel, although I am not sure on how easily this can be implemented. I suppose it would be best if :write itself was done asynchronously, but then it would still be editable while sending it, which doesn't seem wise.

lenormf commented 4 years ago

Isn't it the filesystem's job to handle writes in a high-latency mount point?

L-as commented 4 years ago

@lenormf I don't think it is. Isn't this why we have things like io_uring now?

L-as commented 4 years ago

I just noticed that besides this being a source of latency, kakoune just seems extremely slow at writing to files compared to e.g. echo > $file.

krobelus commented 4 years ago

I just noticed that besides this being a source of latency, kakoune just seems extremely slow at writing to files compared to e.g. echo > $file.

Do you have a simple reproducer that shows the difference?

L-as commented 4 years ago

@krobelus No, unfortunately. It may honestly just be sshfs's fault or it doing some odd things, so I might very well be wrong. (I just compared it with my eyes, so it may also be some mental trickery)