lewis6991 / impatient.nvim

Improve startup time for Neovim
MIT License
1.19k stars 28 forks source link

Enable profiling errors when used with fzy-lua-native #35

Closed akinsho closed 2 years ago

akinsho commented 3 years ago

Hi,

When requiring https://github.com/romgrk/fzy-lua-native the following error is thrown, it appears there is an assertion on that line assert(pb.exec > 0) which fails.

wilder: draw: Vim(return):E5108: Error executing lua ...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:146: ...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:164: assertion failed!

This issue began a few weeks/commits ago but previously worked an is only visible when impatient.enable_profile() is used otherwise it doesn't occur.

For context this plugin is being used by wilder.nvim which internally is requiring fzy-lua-native

    use {
      'gelguy/wilder.nvim',
      event = { 'CursorHold', 'CmdlineEnter' },
      rocks = { 'luarocks-fetch-gitrec', 'pcre2' },
      requires = { 'romgrk/fzy-lua-native' },
    }

I don't know entirely but it seems like the fzy-native package probably doesn't have the same setup as other modules and so this check doesn't apply for it. I don't know what exec is supposed to be but is seems like maybe a package should be skipped if doesn't have one.

lewis6991 commented 3 years ago

There are 3 main sections when running require:

The sum of these is the total time to require. However, the profiler excludes sub-requires of a module since if that sub-module is required by another module, then the second require cost will be significantly lower, so to make the profiler useful we exclude these. This means the profiler results shouldn't be effected by module load order.

akinsho commented 3 years ago

I'm not sure how the above connects to this issue exactly tbh, wilder.nvim requires lua-fzy-native here, from what you are saying this plugin excludes sub-requires by which I guess you mean require'module.submodule' except in this case that's not how the fzy module is required, instead it is required via the main module require'lua-fzy-native' and has no submodules being used by wilder.

lewis6991 commented 2 years ago

Is this still an issue?

akinsho commented 2 years ago

Ah sorry I forgot this was still open. I actually no longer use wilder and don't use the profiling functionality anymore either. So I'm not sure. Last I checked which was quite a while ago. It was still an issue but it's not a setup I use anymore so I can close this out since it's not something I'm still reporting