From 9139bf81cf81a93e331f98dcddbe489fc3529787 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 21 Apr 2018 01:27:55 +0200 Subject: defaults: disable 'fsync' ref #6725 fsync() is very slow on some systems. And since the parent commit, Nvim is smarter about flushing files at certain times (e.g. CursorHold), regardless of whether 'fsync' is enabled. So it's less risky to disable 'fsync'. Profiling showed slow (2-4s) :write and :quit caused by fsync(): :quit shada_write_file(NULL, false); :write + fsync 0 0x00007f72da567b2d in fsync () at ../sysdeps/unix/syscall-template.S:84 1 0x0000000000638970 in uv__fs_fsync (req=) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:150 2 uv__fs_work (w=) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:953 3 0x0000000000639a70 in uv_fs_fsync (loop=, req=, file=41, cb=0x7f72da567b2d ) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:1094 4 0x0000000000573694 in os_fsync (fd=41) at ../src/nvim/os/fs.c:631 5 0x00000000004ec9dc in buf_write (buf=, fname=, sfname=, start=1, end=1997, eap=0x7fffc864c570, append=, forceit=, reset_changed=, filtering=) at ../src/nvim/fileio.c:3387 6 0x00000000004b44ff in do_write (eap=0x7fffc864c570) at ../src/nvim/ex_cmds.c:1745 ... :write + nofsync 0 0x00007f72da567b2d in fsync () at ../sysdeps/unix/syscall-template.S:84 1 0x0000000000638970 in uv__fs_fsync (req=) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:150 2 uv__fs_work (w=) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:953 3 0x0000000000639a70 in uv_fs_fsync (loop=, req=, file=36, cb=0x7f72da567b2d ) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:1094 4 0x0000000000573694 in os_fsync (fd=36) at ../src/nvim/os/fs.c:631 5 0x0000000000528f5a in mf_sync (mfp=0x7f72d8968d00, flags=5) at ../src/nvim/memfile.c:466 6 0x000000000052d569 in ml_preserve (buf=0x7f72d890f000, message=0) at ../src/nvim/memline.c:1659 7 0x00000000004ebadf in buf_write (buf=, fname=, sfname=, start=1, end=1997, eap=0x7fffc864c570, append=, forceit=, reset_changed=, filtering=) at ../src/nvim/fileio.c:3071 8 0x00000000004b44ff in do_write (eap=0x7fffc864c570) at ../src/nvim/ex_cmds.c:1745 ... --- src/nvim/options.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 80484d0ad2..66018b2475 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -976,7 +976,7 @@ return { secure=true, vi_def=true, varname='p_fs', - defaults={if_true={vi=true}} + defaults={if_true={vi=false}} }, { full_name='gdefault', abbreviation='gd', -- cgit