Sunday, July 16, 2023

Re: Improving vim startuptime

On Sun, Jul 16, 2023 at 01:47:37PM -0700, Gary Johnson wrote:
> On 2023-07-17, Manas wrote:
> > I was using `hyperfine -i /usr/bin/vim`.
> >
> > But I tested with above commands too.
> >
> > ```
> > $ hyperfine "vim -cq"
> > Benchmark 1: vim -cq
> > Time (mean ± σ): 2.414 s ± 0.017 s [User: 0.358 s, System: 0.048 s]
> > Range (min … max): 2.392 s … 2.447 s 10 runs
> >
> >
> > $ hyperfine "vim -N -u NONE -i NONE -X -cq"
> > Benchmark 1: vim -N -u NONE -i NONE -X -cq
> > Time (mean ± σ): 2.047 s ± 0.006 s [User: 0.032 s, System: 0.010 s]
> > Range (min … max): 2.039 s … 2.056 s 10 runs
> > ```
>
> Interesting! That's crazy. It should not take nearly that long to
> execute that last command. Vim is not doing anything but starting
> without loading any files, then immediately exiting.
>
> Is that what you observe without using hyperfine?
I am starting to think this is some hyperfine issue. Because,

```
$ time vim -cq

real 0m0.396s
user 0m0.346s
sys 0m0.047s

$ time vim -N -u NONE -i NONE -X -cq

real 0m0.035s
user 0m0.022s
sys 0m0.013s
```

> I've never used hyperfine; I've just read about it since your post.
> I usually run a command with the time command, throw away the first
> run because it includes the time time to fill caches, then average
> the next three.
>
> For example:
>
> $ time vim -N -u NONE -i NONE -X -cq
>
> real 0m0.030s
> user 0m0.013s
> sys 0m0.016s
>
> What is the output of that command on your system?
>
> I'm thinking that maybe we should try running vim under strace. Try
> this and see what strace.out shows the running time to be.
>
> $ strace -f -tt -o strace.out --summary vim -N -u NONE -i NONE -X -cq
>
> The summary total time varies, but I get about 10 ms.
>
I am also getting 10ms. Here is the detailed log.
https://pastebin.mozilla.org/1PU0phce

--
Manas

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/sm5isalvcunuqhvmoyj64i7rsfyfkqzz4yy6sziabnvzuceyqe%40lpvxm3oi33r7.

No comments: