Code Monkey home page Code Monkey logo

impatient.nvim's Introduction

NOTICE

As of Neovim 0.9, this plugin is no longer required. Instead run:

vim.loader.enable()

impatient.nvim

CI

Speed up loading Lua modules in Neovim to improve startup time.

Optimisations

This plugin does several things to speed loading Lua modules and files.

Implements a chunk cache

This is done by using loadstring to compile the Lua modules to bytecode and stores them in a cache file. The cache is invalidated using as hash consisting of:

  • The modified time (sec and nsec) of the file path.
  • The file size.

The cache file is located in $XDG_CACHE_HOME/nvim/luacache_chunks.

Implements a module resolution cache

This is done by maintaining a table of module name to path. The cache is invalidated only if a path no longer exists.

The cache file is located in $XDG_CACHE_HOME/nvim/luacache_modpaths.

Note: This optimization breaks the loading order guarantee of the paths in 'runtimepath'. If you rely on this ordering then you can disable this cache (_G.__luacache_config = { modpaths = { enable = false } }. See configuration below for more details.

Requirements

  • Neovim v0.7

Installation

packer.nvim:

-- Is using a standard Neovim install, i.e. built from source or using a
-- provided appimage.
use 'lewis6991/impatient.nvim'

Setup

To use impatient, you need only to include it near the top of your init.lua or init.vim.

init.lua:

require('impatient')

init.vim:

lua require('impatient')

Commands

:LuaCacheClear:

Remove the loaded cache and delete the cache file. A new cache file will be created the next time you load Neovim.

:LuaCacheLog:

View log of impatient.

:LuaCacheProfile:

View profiling data. To enable, Impatient must be setup with:

lua require'impatient'.enable_profile()

Configuration

Unlike most plugins which provide a setup() function, Impatient uses a configuration table stored in the global state, _G.__luacache_config. If you modify the default configuration, it must be done before require('impatient') is run.

Default config:

_G.__luacache_config = {
  chunks = {
    enable = true,
    path = vim.fn.stdpath('cache')..'/luacache_chunks',
  },
  modpaths = {
    enable = true,
    path = vim.fn.stdpath('cache')..'/luacache_modpaths',
  }
}
require('impatient')

Performance Example

Measured on a M1 MacBook Air.

Standard
────────────┬────────────┐
 Resolve    │ Load       │
────────────┼────────────┼─────────────────────────────────────────────────────────────────
 Time       │ Time       │ Module
────────────┼────────────┼─────────────────────────────────────────────────────────────────
   54.337ms │   34.257ms │ Total
────────────┼────────────┼─────────────────────────────────────────────────────────────────
    7.264ms │    0.470ms │ octo.colors
    3.154ms │    0.128ms │ diffview.bootstrap
    2.086ms │    0.231ms │ gitsigns
    0.320ms │    0.982ms │ octo.date
    0.296ms │    1.004ms │ octo.writers
    0.322ms │    0.893ms │ octo.utils
    0.293ms │    0.854ms │ vim.diagnostic
    0.188ms │    0.819ms │ vim.lsp.util
    0.261ms │    0.739ms │ vim.lsp
    0.330ms │    0.620ms │ octo.model.octo-buffer
    0.392ms │    0.422ms │ packer.load
    0.287ms │    0.436ms │ octo.reviews
    0.367ms │    0.325ms │ octo
    0.309ms │    0.381ms │ octo.graphql
    0.454ms │    0.221ms │ octo.base64
    0.295ms │    0.338ms │ octo.reviews.file-panel
    0.305ms │    0.306ms │ octo.reviews.file-entry
    0.183ms │    0.386ms │ vim.treesitter.query
    0.418ms │    0.149ms │ vim.uri
    0.342ms │    0.213ms │ octo.config
    0.110ms │    0.430ms │ nvim-lsp-installer.ui.status-win
    0.296ms │    0.209ms │ octo.window
    0.202ms │    0.288ms │ vim.lsp.rpc
    0.352ms │    0.120ms │ octo.gh
    0.287ms │    0.184ms │ octo.reviews.layout
    0.209ms │    0.260ms │ vim.lsp.handlers
    0.108ms │    0.360ms │ luasnip.nodes.snippet
    0.243ms │    0.212ms │ dirvish
    0.289ms │    0.159ms │ octo.mappings
    0.228ms │    0.220ms │ trouble.view
    0.145ms │    0.293ms │ plenary.job
    0.188ms │    0.244ms │ vim.lsp.diagnostic
    0.032ms │    0.391ms │ packer_compiled
    0.188ms │    0.228ms │ vim.lsp.buf
    0.186ms │    0.227ms │ vim.lsp.protocol
    0.141ms │    0.264ms │ nvim-treesitter.install
    0.205ms │    0.190ms │ vim.lsp._snippet
    0.114ms │    0.281ms │ colorizer
    0.124ms │    0.262ms │ nvim-treesitter.parsers
    0.331ms │    0.052ms │ octo.model.body-metadata
    0.325ms │    0.054ms │ octo.constants
    0.296ms │    0.081ms │ octo.reviews.renderer
    0.326ms │    0.050ms │ octo.model.thread-metadata
    0.258ms │    0.117ms │ trouble
    0.106ms │    0.267ms │ cmp.core
    0.286ms │    0.085ms │ octo.completion
    0.120ms │    0.250ms │ luasnip
    0.286ms │    0.084ms │ octo.ui.bubbles
    0.068ms │    0.298ms │ diffview.utils
    0.325ms │    0.039ms │ octo.model.title-metadata
    0.126ms │    0.234ms │ treesitter-context
    0.282ms │    0.073ms │ octo.signs
    0.299ms │    0.043ms │ octo.folds
    0.112ms │    0.228ms │ luasnip.util.util
    0.181ms │    0.156ms │ vim.treesitter.languagetree
    0.260ms │    0.073ms │ vim.keymap
    0.101ms │    0.231ms │ cmp.entry
    0.182ms │    0.145ms │ vim.treesitter.highlighter
    0.191ms │    0.121ms │ trouble.util
    0.190ms │    0.119ms │ vim.lsp.codelens
    0.190ms │    0.117ms │ vim.lsp.sync
    0.197ms │    0.105ms │ vim.highlight
    0.170ms │    0.132ms │ spellsitter
    0.086ms │    0.213ms │ github_dark
    0.200ms │    0.099ms │ persistence
    0.100ms │    0.196ms │ cmp.view.custom_entries_view
    0.118ms │    0.176ms │ nvim-treesitter.configs
    0.090ms │    0.201ms │ gitsigns.git
    0.114ms │    0.170ms │ nvim-lsp-installer.ui.display
    0.217ms │    0.064ms │ plenary.async.async
    0.195ms │    0.078ms │ vim.lsp.log
    0.191ms │    0.081ms │ trouble.renderer
    0.122ms │    0.150ms │ nvim-treesitter.ts_utils
    0.235ms │    0.035ms │ plenary
    0.100ms │    0.168ms │ cmp.source
    0.191ms │    0.076ms │ vim.treesitter
    0.106ms │    0.160ms │ lspconfig.util
    0.118ms │    0.147ms │ nvim-treesitter.query
    0.088ms │    0.176ms │ gitsigns.config
    0.108ms │    0.150ms │ cmp
    0.193ms │    0.063ms │ trouble.providers
    0.206ms │    0.050ms │ tmux.version.parse
    0.103ms │    0.151ms │ cmp.view.wildmenu_entries_view
    0.070ms │    0.178ms │ diffview.path
    0.189ms │    0.058ms │ trouble.providers.lsp
    0.096ms │    0.147ms │ luasnip.util.parser
    0.093ms │    0.150ms │ gitsigns.manager
    0.097ms │    0.145ms │ null-ls.utils
    0.155ms │    0.087ms │ plenary.async.control
    0.105ms │    0.135ms │ nvim-lsp-installer.installers.std
    0.107ms │    0.130ms │ lspconfig.configs
    0.097ms │    0.140ms │ null-ls.helpers.generator_factory
    0.188ms │    0.047ms │ trouble.providers.telescope
    0.191ms │    0.040ms │ trouble.config
    0.099ms │    0.131ms │ cmp.utils.window
    0.096ms │    0.133ms │ luasnip.nodes.choiceNode
    0.192ms │    0.036ms │ trouble.providers.qf
    0.104ms │    0.124ms │ cmp.utils.keymap
    0.089ms │    0.139ms │ gitsigns.hunks
    0.104ms │    0.122ms │ nvim-lsp-installer.process
    0.096ms │    0.129ms │ null-ls.sources
    0.116ms │    0.108ms │ nvim-lsp-installer
    0.096ms │    0.128ms │ luasnip.nodes.dynamicNode
    0.162ms │    0.062ms │ tmux.copy
    0.197ms │    0.025ms │ trouble.folds
    0.156ms │    0.066ms │ plenary.async.util
    0.150ms │    0.071ms │ cmp.utils.highlight
    0.105ms │    0.116ms │ nvim-lsp-installer.server
    0.118ms │    0.100ms │ nvim-treesitter.utils
    0.182ms │    0.035ms │ trouble.providers.diagnostic
    0.103ms │    0.114ms │ luasnip.nodes.node
    0.185ms │    0.031ms │ trouble.colors
    0.180ms │    0.035ms │ vim.ui
    0.162ms │    0.053ms │ spaceless
    0.118ms │    0.097ms │ nvim-treesitter.shell_command_selectors
    0.160ms │    0.053ms │ tmux.wrapper.tmux
    0.182ms │    0.031ms │ vim.treesitter.language
    0.178ms │    0.035ms │ trouble.text
    0.157ms │    0.054ms │ plenary.vararg.rotate
    0.106ms │    0.104ms │ nvim-lsp-installer.installers.context
    0.181ms │    0.028ms │ tmux
    0.158ms │    0.050ms │ nvim-treesitter-playground
    0.067ms │    0.140ms │ diffview.oop
    0.158ms │    0.047ms │ tmux.resize
    0.166ms │    0.039ms │ tmux.log.convert
    0.161ms │    0.044ms │ tmux.layout
    0.155ms │    0.048ms │ plenary.async.structs
    0.101ms │    0.102ms │ cmp.view
    0.096ms │    0.105ms │ luasnip.util.environ
    0.145ms │    0.055ms │ plenary.async
    0.163ms │    0.037ms │ tmux.navigation.navigate
    0.179ms │    0.020ms │ tmux.keymaps
    0.155ms │    0.044ms │ plenary.functional
    0.102ms │    0.097ms │ cmp.matcher
    0.103ms │    0.095ms │ cmp.view.ghost_text_view
    0.106ms │    0.091ms │ colorizer.nvim
    0.168ms │    0.029ms │ tmux.log
    0.106ms │    0.090ms │ nvim-lsp-installer._generated.filetype_map
    0.122ms │    0.073ms │ nvim-treesitter.info
    0.098ms │    0.097ms │ null-ls.client
    0.105ms │    0.089ms │ nvim-lsp-installer.log
    0.170ms │    0.024ms │ tmux.navigation
    0.109ms │    0.084ms │ nvim-lsp-installer.servers
    0.098ms │    0.095ms │ null-ls.helpers.diagnostics
    0.160ms │    0.033ms │ tmux.configuration.options
    0.100ms │    0.091ms │ cmp.utils.misc
    0.044ms │    0.148ms │ lewis6991
    0.104ms │    0.088ms │ colorizer.trie
    0.163ms │    0.028ms │ ts_context_commentstring
    0.054ms │    0.136ms │ cmp-rg
    0.130ms │    0.060ms │ nvim-treesitter.query_predicates
    0.151ms │    0.039ms │ plenary.reload
    0.096ms │    0.094ms │ luasnip.nodes.insertNode
    0.160ms │    0.028ms │ tmux.layout.parse
    0.096ms │    0.093ms │ luasnip.nodes.restoreNode
    0.166ms │    0.022ms │ tmux.configuration.validate
    0.100ms │    0.088ms │ cmp.view.native_entries_view
    0.155ms │    0.033ms │ plenary.tbl
    0.126ms │    0.062ms │ lspconfig.server_configurations.sumneko_lua
    0.029ms │    0.160ms │ cmp_buffer.buffer
    0.105ms │    0.083ms │ cmp.utils.str
    0.162ms │    0.025ms │ tmux.log.severity
    0.164ms │    0.024ms │ tmux.wrapper.nvim
    0.107ms │    0.081ms │ nvim-lsp-installer.ui.status-win.components.settings-schema
    0.021ms │    0.167ms │ lewis6991.null-ls
    0.163ms │    0.024ms │ tmux.configuration
    0.116ms │    0.071ms │ nvim-treesitter.tsrange
    0.161ms │    0.026ms │ tmux.log.channels
    0.094ms │    0.091ms │ gitsigns.debug
    0.163ms │    0.021ms │ plenary.vararg
    0.166ms │    0.018ms │ tmux.version
    0.160ms │    0.022ms │ tmux.configuration.logging
    0.155ms │    0.026ms │ plenary.errors
    0.127ms │    0.053ms │ nvim-treesitter
    0.094ms │    0.085ms │ null-ls.info
    0.100ms │    0.079ms │ cmp.config
    0.095ms │    0.084ms │ null-ls.diagnostics
    0.055ms │    0.123ms │ cmp_path
    0.139ms │    0.038ms │ plenary.async.tests
    0.098ms │    0.078ms │ null-ls.config
    0.100ms │    0.076ms │ cmp.view.docs_view
    0.102ms │    0.074ms │ cmp.utils.feedkeys
    0.089ms │    0.085ms │ gitsigns.current_line_blame
    0.127ms │    0.047ms │ null-ls
    0.107ms │    0.066ms │ nvim-lsp-installer.installers
    0.095ms │    0.078ms │ luasnip.util.mark
    0.106ms │    0.066ms │ nvim-lsp-installer.fs
    0.142ms │    0.030ms │ persistence.config
    0.100ms │    0.070ms │ cmp.config.default
    0.078ms │    0.091ms │ foldsigns
    0.120ms │    0.048ms │ lua-dev
    0.113ms │    0.053ms │ nvim-lsp-installer.ui
    0.029ms │    0.138ms │ lewis6991.status
    0.118ms │    0.047ms │ lspconfig
    0.113ms │    0.051ms │ nvim-lsp-installer.jobs.outdated-servers
    0.105ms │    0.058ms │ nvim-lsp-installer.installers.npm
    0.106ms │    0.057ms │ nvim-lsp-installer.core.receipt
    0.101ms │    0.061ms │ cmp.utils.char
    0.091ms │    0.071ms │ gitsigns.signs
    0.097ms │    0.065ms │ luasnip.nodes.util
    0.126ms │    0.034ms │ treesitter-context.utils
    0.096ms │    0.065ms │ lua-dev.config
    0.109ms │    0.052ms │ nvim-lsp-installer.core.fetch
    0.103ms │    0.055ms │ cmp.types.lsp
    0.099ms │    0.059ms │ luasnip.nodes.functionNode
    0.090ms │    0.067ms │ gitsigns.util
    0.110ms │    0.047ms │ nvim-lsp-installer.jobs.outdated-servers.cargo
    0.096ms │    0.061ms │ luasnip.config
    0.100ms │    0.057ms │ cmp.utils.async
    0.101ms │    0.055ms │ cmp.context
    0.091ms │    0.064ms │ gitsigns.highlight
    0.094ms │    0.061ms │ lua-dev.sumneko
    0.094ms │    0.061ms │ gitsigns.subprocess
    0.067ms │    0.088ms │ cmp_luasnip
    0.105ms │    0.050ms │ nvim-lsp-installer.data
    0.105ms │    0.049ms │ nvim-lsp-installer.installers.pip3
    0.120ms │    0.034ms │ lspconfig.server_configurations.bashls
    0.107ms │    0.046ms │ nvim-lsp-installer.core.clients.github
    0.107ms │    0.045ms │ nvim-lsp-installer.installers.shell
    0.099ms │    0.053ms │ cmp.config.compare
    0.109ms │    0.043ms │ lspconfig.server_configurations.clangd
    0.115ms │    0.036ms │ lspconfig.server_configurations.vimls
    0.097ms │    0.054ms │ luasnip.util.pattern_tokenizer
    0.097ms │    0.053ms │ null-ls.helpers.make_builtin
    0.101ms │    0.049ms │ cmp.utils.api
    0.118ms │    0.032ms │ lspconfig.server_configurations.jedi_language_server
    0.106ms │    0.043ms │ nvim-lsp-installer.jobs.outdated-servers.pip3
    0.106ms │    0.043ms │ nvim-lsp-installer.jobs.outdated-servers.gem
    0.108ms │    0.040ms │ nvim-lsp-installer._generated.language_autocomplete_map
    0.104ms │    0.043ms │ nvim-lsp-installer.installers.composer
    0.101ms │    0.046ms │ cmp.config.mapping
    0.047ms │    0.100ms │ cmp_nvim_lsp_signature_help
    0.109ms │    0.037ms │ nvim-lsp-installer.servers.sumneko_lua
    0.115ms │    0.028ms │ nvim-treesitter.caching
    0.096ms │    0.047ms │ null-ls.state
    0.090ms │    0.053ms │ gitsigns.debounce
    0.059ms │    0.084ms │ cmp_tmux.tmux
    0.096ms │    0.045ms │ null-ls.builtins.diagnostics.flake8
    0.106ms │    0.034ms │ nvim-lsp-installer.jobs.pool
    0.106ms │    0.033ms │ nvim-lsp-installer.ui.status-win.server_hints
    0.105ms │    0.034ms │ nvim-lsp-installer.installers.gem
    0.107ms │    0.032ms │ nvim-lsp-installer.jobs.outdated-servers.npm
    0.106ms │    0.031ms │ nvim-lsp-installer.jobs.outdated-servers.git
    0.114ms │    0.022ms │ nvim-lsp-installer.servers.jedi_language_server
    0.105ms │    0.031ms │ nvim-lsp-installer.jobs.outdated-servers.composer
    0.098ms │    0.038ms │ null-ls.methods
    0.109ms │    0.026ms │ nvim-lsp-installer.jobs.outdated-servers.version-check-result
    0.106ms │    0.029ms │ nvim-lsp-installer.settings
    0.107ms │    0.027ms │ cmp.utils.debug
    0.103ms │    0.031ms │ cmp.types.cmp
    0.070ms │    0.064ms │ diffview.events
    0.108ms │    0.026ms │ nvim-lsp-installer.platform
    0.097ms │    0.037ms │ null-ls.helpers.command_resolver
    0.104ms │    0.029ms │ cmp.config.sources
    0.107ms │    0.026ms │ nvim-lsp-installer.jobs.outdated-servers.github_release_file
    0.099ms │    0.033ms │ cmp.utils.cache
    0.107ms │    0.025ms │ nvim-lsp-installer.path
    0.101ms │    0.030ms │ cmp.utils.autocmd
    0.097ms │    0.034ms │ null-ls.logger
    0.100ms │    0.031ms │ cmp.utils.event
    0.088ms │    0.042ms │ gitsigns.cache
    0.103ms │    0.027ms │ cmp.utils.pattern
    0.108ms │    0.022ms │ nvim-lsp-installer.jobs.outdated-servers.jdtls
    0.103ms │    0.027ms │ cmp.utils.buffer
    0.095ms │    0.034ms │ luasnip.nodes.textNode
    0.096ms │    0.033ms │ luasnip.util.dict
    0.108ms │    0.021ms │ nvim-lsp-installer.servers.bashls
    0.108ms │    0.021ms │ nvim-lsp-installer.ui.state
    0.110ms │    0.018ms │ nvim-lsp-installer.servers.vimls
    0.101ms │    0.027ms │ null-ls.helpers.range_formatting_args_factory
    0.057ms │    0.071ms │ cmp_treesitter.lru
    0.105ms │    0.022ms │ nvim-lsp-installer.dispatcher
    0.097ms │    0.030ms │ luasnip.extras.filetype_functions
    0.103ms │    0.024ms │ luasnip.session
    0.105ms │    0.021ms │ nvim-lsp-installer.core.clients.crates
    0.105ms │    0.021ms │ nvim-lsp-installer.jobs.outdated-servers.github_tag
    0.110ms │    0.016ms │ cmp.types
    0.105ms │    0.021ms │ nvim-lsp-installer.core.clients.eclipse
    0.105ms │    0.021ms │ nvim-lsp-installer.notify
    0.089ms │    0.036ms │ gitsigns.status
    0.096ms │    0.029ms │ null-ls.builtins.diagnostics.teal
    0.097ms │    0.027ms │ null-ls.builtins
    0.103ms │    0.021ms │ cmp.types.vim
    0.060ms │    0.062ms │ cmp_tmux.source
    0.100ms │    0.022ms │ null-ls.helpers
    0.098ms │    0.024ms │ null-ls.builtins.diagnostics.gitlint
    0.065ms │    0.056ms │ cmp_treesitter
    0.024ms │    0.097ms │ buftabline.buftab
    0.095ms │    0.026ms │ null-ls.builtins.diagnostics.shellcheck
    0.095ms │    0.026ms │ null-ls.builtins.diagnostics.luacheck
    0.097ms │    0.021ms │ null-ls.helpers.formatter_factory
    0.097ms │    0.022ms │ luasnip.util.events
    0.097ms │    0.021ms │ luasnip.util.types
    0.096ms │    0.022ms │ luasnip.util.functions
    0.037ms │    0.078ms │ cmp_cmdline
    0.032ms │    0.083ms │ cmp_buffer.source
    0.040ms │    0.074ms │ lewis6991.cmp
    0.060ms │    0.054ms │ cmp_treesitter.treesitter
    0.089ms │    0.025ms │ gitsigns.message
    0.039ms │    0.073ms │ cmp_nvim_lsp.source
    0.055ms │    0.054ms │ buftabline.build
    0.026ms │    0.083ms │ lewis6991.lsp
    0.051ms │    0.055ms │ cmp_nvim_lua
    0.033ms │    0.065ms │ cleanfold
    0.071ms │    0.025ms │ cmp_tmux
    0.043ms │    0.053ms │ cmp_nvim_lsp
    0.058ms │    0.033ms │ cmp-spell
    0.043ms │    0.037ms │ cmp_emoji
    0.029ms │    0.049ms │ lewis6991.floating_man
    0.032ms │    0.042ms │ cmp_buffer.timer
    0.024ms │    0.050ms │ lewis6991.treesitter
    0.019ms │    0.054ms │ lewis6991.cmp_gh
    0.025ms │    0.046ms │ buftabline.buffers
    0.021ms │    0.048ms │ lewis6991.telescope
    0.024ms │    0.031ms │ buftabline
    0.035ms │    0.019ms │ cmp_buffer
    0.019ms │    0.035ms │ buftabline.utils
    0.021ms │    0.030ms │ buftabline.highlights
    0.020ms │    0.032ms │ buftabline.tabpage-tab
    0.019ms │    0.030ms │ buftabline.options
    0.020ms │    0.026ms │ buftabline.tabpages
────────────┴────────────┴─────────────────────────────────────────────────────────────────

Total resolve: 54.337ms, total load: 34.257ms

With cache
────────────┬────────────┐
 Resolve    │ Load       │
────────────┼────────────┼─────────────────────────────────────────────────────────────────
 Time       │ Time       │ Module
────────────┼────────────┼─────────────────────────────────────────────────────────────────
    6.357ms │    6.796ms │ Total
────────────┼────────────┼─────────────────────────────────────────────────────────────────
    0.041ms │    2.021ms │ octo.writers
    0.118ms │    0.160ms │ lewis6991.plugins
    0.050ms │    0.144ms │ octo.date
    0.035ms │    0.153ms │ octo.utils
    0.057ms │    0.099ms │ octo.model.octo-buffer
    0.047ms │    0.105ms │ packer
    0.058ms │    0.080ms │ octo.colors
    0.121ms │    0.015ms │ gitsigns.cache
    0.082ms │    0.037ms │ packer.load
    0.107ms │    0.008ms │ gitsigns.debounce
    0.048ms │    0.064ms │ octo.config
    0.048ms │    0.061ms │ octo.graphql
    0.049ms │    0.051ms │ octo
    0.043ms │    0.057ms │ vim.diagnostic
    0.085ms │    0.013ms │ gitsigns.highlight
    0.065ms │    0.032ms │ octo.base64
    0.035ms │    0.060ms │ vim.lsp
    0.056ms │    0.035ms │ octo.gh
    0.045ms │    0.045ms │ octo.mappings
    0.026ms │    0.060ms │ octo.reviews
    0.037ms │    0.045ms │ packer.plugin_utils
    0.030ms │    0.049ms │ octo.reviews.file-panel
    0.018ms │    0.056ms │ vim.lsp.util
    0.043ms │    0.030ms │ packer.log
    0.036ms │    0.032ms │ packer.util
    0.032ms │    0.035ms │ octo.reviews.file-entry
    0.021ms │    0.045ms │ packer_compiled
    0.052ms │    0.014ms │ octo.model.body-metadata
    0.033ms │    0.027ms │ octo.reviews.layout
    0.014ms │    0.047ms │ nvim-treesitter.parsers
    0.035ms │    0.024ms │ vim.lsp.handlers
    0.014ms │    0.044ms │ nvim-lsp-installer.ui.status-win
    0.046ms │    0.012ms │ octo.completion
    0.037ms │    0.021ms │ octo.constants
    0.032ms │    0.025ms │ lewis6991
    0.040ms │    0.017ms │ persistence
    0.030ms │    0.026ms │ diffview.utils
    0.035ms │    0.020ms │ packer.result
    0.015ms │    0.040ms │ gitsigns.config
    0.031ms │    0.024ms │ packer.async
    0.041ms │    0.013ms │ vim.uri
    0.044ms │    0.010ms │ octo.model.thread-metadata
    0.018ms │    0.035ms │ gitsigns.debug
    0.023ms │    0.030ms │ github_dark
    0.030ms │    0.023ms │ packer.jobs
    0.039ms │    0.013ms │ buftabline.build
    0.037ms │    0.014ms │ octo.model.title-metadata
    0.025ms │    0.025ms │ vim.lsp.buf
    0.022ms │    0.027ms │ gitsigns
    0.027ms │    0.022ms │ lewis6991.status
    0.016ms │    0.032ms │ gitsigns.git
    0.026ms │    0.020ms │ octo.window
    0.033ms │    0.012ms │ octo.folds
    0.037ms │    0.008ms │ trouble.providers.lsp
    0.016ms │    0.028ms │ vim.lsp.protocol
    0.028ms │    0.016ms │ octo.signs
    0.028ms │    0.014ms │ null-ls
    0.027ms │    0.014ms │ octo.reviews.renderer
    0.018ms │    0.024ms │ trouble.view
    0.017ms │    0.025ms │ luasnip.nodes.snippet
    0.023ms │    0.018ms │ colorizer.nvim
    0.017ms │    0.024ms │ vim.lsp._snippet
    0.015ms │    0.025ms │ nvim-treesitter.install
    0.018ms │    0.022ms │ plenary.async.structs
    0.018ms │    0.021ms │ dirvish
    0.027ms │    0.012ms │ octo.ui.bubbles
    0.019ms │    0.020ms │ treesitter-context
    0.015ms │    0.024ms │ vim.lsp.diagnostic
    0.016ms │    0.023ms │ vim.lsp.rpc
    0.022ms │    0.016ms │ trouble
    0.022ms │    0.016ms │ null-ls.helpers.generator_factory
    0.020ms │    0.017ms │ luasnip
    0.014ms │    0.023ms │ plenary.job
    0.026ms │    0.011ms │ lewis6991.cmp
    0.027ms │    0.010ms │ trouble.providers
    0.022ms │    0.014ms │ nvim-treesitter.query
    0.018ms │    0.018ms │ vim.treesitter.highlighter
    0.017ms │    0.018ms │ nvim-treesitter.shell_command_selectors
    0.014ms │    0.021ms │ nvim-treesitter.configs
    0.025ms │    0.010ms │ lewis6991.floating_man
    0.022ms │    0.012ms │ vim.keymap
    0.013ms │    0.021ms │ cmp.entry
    0.024ms │    0.010ms │ lspconfig.server_configurations.bashls
    0.018ms │    0.016ms │ gitsigns.hunks
    0.017ms │    0.017ms │ gitsigns.status
    0.014ms │    0.019ms │ cmp.core
    0.018ms │    0.015ms │ spellsitter
    0.014ms │    0.019ms │ colorizer
    0.024ms │    0.009ms │ diffview.bootstrap
    0.016ms │    0.016ms │ null-ls.utils
    0.021ms │    0.011ms │ nvim-treesitter.info
    0.022ms │    0.010ms │ vim.highlight
    0.016ms │    0.016ms │ null-ls.info
    0.019ms │    0.013ms │ cmp_path
    0.026ms │    0.006ms │ cmp.utils.autocmd
    0.021ms │    0.011ms │ foldsigns
    0.014ms │    0.018ms │ lewis6991.null-ls
    0.018ms │    0.013ms │ cmp.view
    0.017ms │    0.014ms │ null-ls.client
    0.016ms │    0.015ms │ gitsigns.manager
    0.013ms │    0.018ms │ cmp.view.custom_entries_view
    0.015ms │    0.015ms │ nvim-lsp-installer.ui.display
    0.020ms │    0.010ms │ null-ls.methods
    0.016ms │    0.014ms │ plenary.async.control
    0.019ms │    0.011ms │ null-ls.diagnostics
    0.014ms │    0.015ms │ luasnip.util.util
    0.017ms │    0.013ms │ gitsigns.current_line_blame
    0.013ms │    0.016ms │ buftabline.buftab
    0.015ms │    0.015ms │ trouble.util
    0.015ms │    0.015ms │ luasnip.config
    0.019ms │    0.010ms │ plenary.async.async
    0.018ms │    0.012ms │ nvim-treesitter.tsrange
    0.021ms │    0.007ms │ cmp_nvim_lua
    0.014ms │    0.015ms │ vim.treesitter.query
    0.015ms │    0.014ms │ cmp.source
    0.014ms │    0.015ms │ vim.treesitter.languagetree
    0.012ms │    0.016ms │ nvim-lsp-installer._generated.filetype_map
    0.015ms │    0.014ms │ nvim-lsp-installer.servers
    0.014ms │    0.014ms │ lspconfig.util
    0.011ms │    0.017ms │ cmp
    0.015ms │    0.013ms │ cmp.view.wildmenu_entries_view
    0.021ms │    0.007ms │ lspconfig.server_configurations.jedi_language_server
    0.015ms │    0.013ms │ lua-dev
    0.018ms │    0.010ms │ gitsigns.util
    0.014ms │    0.014ms │ vim.lsp.codelens
    0.017ms │    0.011ms │ plenary.async.util
    0.013ms │    0.014ms │ null-ls.sources
    0.015ms │    0.012ms │ nvim-treesitter.query_predicates
    0.013ms │    0.015ms │ luasnip.nodes.choiceNode
    0.015ms │    0.013ms │ null-ls.helpers.diagnostics
    0.017ms │    0.011ms │ trouble.renderer
    0.015ms │    0.013ms │ luasnip.nodes.node
    0.014ms │    0.013ms │ lua-dev.sumneko
    0.013ms │    0.014ms │ cmp.utils.window
    0.021ms │    0.006ms │ treesitter-context.utils
    0.018ms │    0.009ms │ cleanfold
    0.015ms │    0.012ms │ nvim-treesitter.ts_utils
    0.012ms │    0.015ms │ nvim-lsp-installer.installers.std
    0.015ms │    0.012ms │ nvim-lsp-installer.server
    0.014ms │    0.012ms │ lewis6991.lsp
    0.016ms │    0.011ms │ gitsigns.signs
    0.020ms │    0.006ms │ buftabline
    0.019ms │    0.007ms │ plenary.tbl
    0.013ms │    0.013ms │ nvim-lsp-installer
    0.018ms │    0.008ms │ plenary
    0.015ms │    0.010ms │ cmp_luasnip
    0.019ms │    0.007ms │ null-ls.logger
    0.016ms │    0.010ms │ vim.lsp.sync
    0.016ms │    0.010ms │ spaceless
    0.017ms │    0.009ms │ gitsigns.subprocess
    0.016ms │    0.009ms │ plenary.functional
    0.016ms │    0.010ms │ buftabline.buffers
    0.016ms │    0.009ms │ vim.lsp.log
    0.019ms │    0.006ms │ cmp_tmux
    0.013ms │    0.012ms │ luasnip.nodes.dynamicNode
    0.017ms │    0.008ms │ vim.treesitter
    0.013ms │    0.013ms │ nvim-lsp-installer.process
    0.013ms │    0.012ms │ luasnip.util.environ
    0.015ms │    0.009ms │ lewis6991.treesitter
    0.015ms │    0.010ms │ null-ls.config
    0.019ms │    0.006ms │ ts_context_commentstring
    0.013ms │    0.012ms │ cmp_buffer.buffer
    0.018ms │    0.007ms │ null-ls.builtins.diagnostics.shellcheck
    0.015ms │    0.010ms │ null-ls.helpers.make_builtin
    0.012ms │    0.012ms │ diffview.path
    0.016ms │    0.008ms │ null-ls.builtins.diagnostics.gitlint
    0.017ms │    0.007ms │ trouble.providers.telescope
    0.013ms │    0.011ms │ diffview.oop
    0.015ms │    0.010ms │ cmp-rg
    0.013ms │    0.011ms │ cmp.utils.keymap
    0.014ms │    0.011ms │ nvim-treesitter
    0.018ms │    0.007ms │ cmp.utils.highlight
    0.016ms │    0.008ms │ lspconfig.server_configurations.sumneko_lua
    0.015ms │    0.009ms │ colorizer.trie
    0.016ms │    0.007ms │ plenary.vararg.rotate
    0.015ms │    0.009ms │ trouble.config
    0.011ms │    0.012ms │ lspconfig.configs
    0.014ms │    0.009ms │ null-ls.helpers.command_resolver
    0.016ms │    0.007ms │ cmp_tmux.source
    0.016ms │    0.007ms │ lspconfig
    0.017ms │    0.006ms │ plenary.vararg
    0.012ms │    0.011ms │ nvim-lsp-installer.installers.context
    0.014ms │    0.009ms │ cmp.view.native_entries_view
    0.014ms │    0.009ms │ cmp.config.default
    0.017ms │    0.006ms │ tmux.version.parse
    0.016ms │    0.007ms │ gitsigns.message
    0.017ms │    0.006ms │ persistence.config
    0.013ms │    0.010ms │ cmp_nvim_lsp_signature_help
    0.012ms │    0.010ms │ cmp.view.docs_view
    0.017ms │    0.006ms │ cmp.config.sources
    0.013ms │    0.009ms │ luasnip.nodes.restoreNode
    0.014ms │    0.009ms │ vim.ui
    0.013ms │    0.010ms │ luasnip.nodes.insertNode
    0.013ms │    0.010ms │ null-ls.state
    0.014ms │    0.008ms │ lspconfig.server_configurations.vimls
    0.016ms │    0.006ms │ plenary.errors
    0.014ms │    0.008ms │ null-ls.builtins.diagnostics.flake8
    0.016ms │    0.006ms │ null-ls.helpers
    0.015ms │    0.008ms │ null-ls.builtins.diagnostics.luacheck
    0.014ms │    0.008ms │ luasnip.util.mark
    0.015ms │    0.008ms │ cmp.utils.buffer
    0.012ms │    0.010ms │ nvim-lsp-installer.log
    0.015ms │    0.007ms │ luasnip.nodes.util
    0.015ms │    0.007ms │ null-ls.builtins.diagnostics.teal
    0.016ms │    0.006ms │ null-ls.helpers.range_formatting_args_factory
    0.012ms │    0.010ms │ nvim-treesitter.utils
    0.015ms │    0.007ms │ cmp.utils.event
    0.013ms │    0.009ms │ tmux.wrapper.tmux
    0.015ms │    0.007ms │ nvim-treesitter-playground
    0.012ms │    0.010ms │ cmp_buffer.source
    0.015ms │    0.007ms │ cmp_treesitter
    0.013ms │    0.009ms │ luasnip.util.parser
    0.015ms │    0.006ms │ trouble.providers.qf
    0.014ms │    0.008ms │ lewis6991.telescope
    0.014ms │    0.007ms │ cmp_tmux.tmux
    0.014ms │    0.007ms │ cmp_nvim_lsp.source
    0.015ms │    0.006ms │ plenary.reload
    0.014ms │    0.008ms │ buftabline.highlights
    0.015ms │    0.006ms │ trouble.providers.diagnostic
    0.015ms │    0.007ms │ nvim-lsp-installer.core.clients.github
    0.014ms │    0.007ms │ nvim-lsp-installer.installers.shell
    0.016ms │    0.005ms │ cmp-spell
    0.014ms │    0.007ms │ null-ls.builtins
    0.013ms │    0.008ms │ cmp_treesitter.lru
    0.016ms │    0.005ms │ buftabline.tabpages
    0.015ms │    0.006ms │ buftabline.options
    0.016ms │    0.005ms │ lua-dev.config
    0.015ms │    0.006ms │ nvim-lsp-installer.jobs.outdated-servers.cargo
    0.014ms │    0.007ms │ diffview.events
    0.013ms │    0.008ms │ nvim-lsp-installer.fs
    0.013ms │    0.008ms │ cmp.utils.feedkeys
    0.013ms │    0.007ms │ nvim-treesitter.caching
    0.013ms │    0.008ms │ nvim-lsp-installer._generated.language_autocomplete_map
    0.013ms │    0.007ms │ cmp.view.ghost_text_view
    0.013ms │    0.008ms │ cmp_nvim_lsp
    0.013ms │    0.007ms │ luasnip.nodes.functionNode
    0.013ms │    0.007ms │ nvim-lsp-installer.jobs.outdated-servers
    0.012ms │    0.008ms │ nvim-lsp-installer.ui.status-win.components.settings-schema
    0.012ms │    0.009ms │ lewis6991.cmp_gh
    0.015ms │    0.006ms │ luasnip.util.dict
    0.013ms │    0.007ms │ plenary.async
    0.014ms │    0.006ms │ nvim-lsp-installer.installers.composer
    0.013ms │    0.007ms │ cmp_treesitter.treesitter
    0.014ms │    0.006ms │ nvim-lsp-installer.jobs.outdated-servers.gem
    0.015ms │    0.005ms │ nvim-lsp-installer.platform
    0.014ms │    0.006ms │ buftabline.utils
    0.013ms │    0.007ms │ trouble.text
    0.011ms │    0.008ms │ cmp.config
    0.013ms │    0.006ms │ trouble.colors
    0.012ms │    0.007ms │ cmp.utils.misc
    0.012ms │    0.008ms │ nvim-lsp-installer.installers.npm
    0.013ms │    0.007ms │ lspconfig.server_configurations.clangd
    0.012ms │    0.007ms │ cmp_cmdline
    0.011ms │    0.008ms │ cmp.types.lsp
    0.014ms │    0.006ms │ vim.treesitter.language
    0.014ms │    0.006ms │ cmp.config.mapping
    0.015ms │    0.004ms │ luasnip.util.events
    0.014ms │    0.005ms │ luasnip.extras.filetype_functions
    0.012ms │    0.007ms │ cmp.utils.async
    0.012ms │    0.007ms │ cmp.config.compare
    0.013ms │    0.005ms │ cmp_emoji
    0.015ms │    0.004ms │ cmp_buffer
    0.011ms │    0.007ms │ nvim-lsp-installer.core.receipt
    0.012ms │    0.007ms │ nvim-lsp-installer.ui
    0.013ms │    0.006ms │ cmp.utils.api
    0.012ms │    0.007ms │ nvim-lsp-installer.core.fetch
    0.013ms │    0.005ms │ nvim-lsp-installer.jobs.pool
    0.011ms │    0.007ms │ nvim-lsp-installer.installers
    0.012ms │    0.007ms │ nvim-lsp-installer.data
    0.013ms │    0.006ms │ cmp.matcher
    0.014ms │    0.005ms │ tmux
    0.011ms │    0.008ms │ tmux.copy
    0.013ms │    0.005ms │ luasnip.util.types
    0.014ms │    0.004ms │ nvim-lsp-installer.servers.jedi_language_server
    0.014ms │    0.004ms │ nvim-lsp-installer.servers.vimls
    0.014ms │    0.004ms │ cmp.utils.cache
    0.013ms │    0.006ms │ luasnip.util.pattern_tokenizer
    0.012ms │    0.006ms │ luasnip.nodes.textNode
    0.013ms │    0.005ms │ null-ls.helpers.formatter_factory
    0.013ms │    0.006ms │ plenary.async.tests
    0.013ms │    0.005ms │ nvim-lsp-installer.jobs.outdated-servers.version-check-result
    0.012ms │    0.005ms │ nvim-lsp-installer.settings
    0.011ms │    0.006ms │ cmp.context
    0.011ms │    0.006ms │ cmp.utils.str
    0.013ms │    0.004ms │ luasnip.session
    0.013ms │    0.005ms │ nvim-lsp-installer.jobs.outdated-servers.composer
    0.012ms │    0.006ms │ nvim-lsp-installer.servers.sumneko_lua
    0.012ms │    0.005ms │ cmp_buffer.timer
    0.011ms │    0.006ms │ cmp.utils.char
    0.013ms │    0.004ms │ cmp.utils.pattern
    0.011ms │    0.006ms │ nvim-lsp-installer.installers.pip3
    0.013ms │    0.004ms │ luasnip.util.functions
    0.013ms │    0.005ms │ tmux.log.channels
    0.012ms │    0.005ms │ tmux.navigation
    0.013ms │    0.005ms │ trouble.folds
    0.012ms │    0.005ms │ nvim-lsp-installer.ui.status-win.server_hints
    0.012ms │    0.005ms │ nvim-lsp-installer.jobs.outdated-servers.pip3
    0.012ms │    0.005ms │ nvim-lsp-installer.jobs.outdated-servers.npm
    0.011ms │    0.006ms │ cmp.utils.debug
    0.013ms │    0.004ms │ nvim-lsp-installer.notify
    0.011ms │    0.006ms │ tmux.layout
    0.013ms │    0.004ms │ nvim-lsp-installer.servers.bashls
    0.012ms │    0.004ms │ nvim-lsp-installer.dispatcher
    0.012ms │    0.005ms │ buftabline.tabpage-tab
    0.012ms │    0.005ms │ nvim-lsp-installer.path
    0.010ms │    0.006ms │ tmux.resize
    0.013ms │    0.004ms │ cmp.types.vim
    0.012ms │    0.004ms │ nvim-lsp-installer.ui.state
    0.011ms │    0.005ms │ nvim-lsp-installer.installers.gem
    0.012ms │    0.005ms │ tmux.configuration.options
    0.012ms │    0.005ms │ nvim-lsp-installer.jobs.outdated-servers.git
    0.012ms │    0.004ms │ nvim-lsp-installer.jobs.outdated-servers.github_release_file
    0.012ms │    0.005ms │ cmp.types.cmp
    0.013ms │    0.004ms │ cmp.types
    0.011ms │    0.005ms │ tmux.log
    0.011ms │    0.005ms │ tmux.navigation.navigate
    0.012ms │    0.005ms │ tmux.configuration
    0.012ms │    0.004ms │ nvim-lsp-installer.jobs.outdated-servers.github_tag
    0.011ms │    0.005ms │ tmux.layout.parse
    0.012ms │    0.004ms │ nvim-lsp-installer.jobs.outdated-servers.jdtls
    0.011ms │    0.005ms │ tmux.log.convert
    0.011ms │    0.005ms │ tmux.log.severity
    0.011ms │    0.004ms │ tmux.version
    0.012ms │    0.004ms │ nvim-lsp-installer.core.clients.eclipse
    0.011ms │    0.004ms │ nvim-lsp-installer.core.clients.crates
    0.011ms │    0.004ms │ tmux.configuration.logging
    0.011ms │    0.004ms │ tmux.wrapper.nvim
    0.011ms │    0.004ms │ tmux.configuration.validate
    0.011ms │    0.004ms │ tmux.keymaps
────────────┴────────────┴─────────────────────────────────────────────────────────────────

Total resolve: 6.357ms, total load: 6.796ms

Relevant Neovim PR's

libs: vendor libmpack and libmpack-lua [merged]

fix(vim.mpack): rename pack/unpack => encode/decode [merged]

fix(runtime): add compressed representation to &rtp [merged]

fix(runtime): don't use regexes inside lua require'mod' [merged]

fix(lua): restore priority of the preloader [merged]

refactor(lua): call loadfile internally instead of luaL_loadfile [merged]

feat(lua): startup profiling

Credit

All credit goes to @bfredl who implemented the majority of this plugin in neovim/neovim#15436.

impatient.nvim's People

Contributors

assistcontrol avatar chase avatar clason avatar hitesh-aggarwal avatar kylo252 avatar lewis6991 avatar max397574 avatar shadmansaleh avatar shurizzle avatar tzachar avatar williamboman avatar younger-1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

impatient.nvim's Issues

Neovim startup is much slow in mac than in linux.

I use neovim 0.8, exactly the same config files in both OS. it’ll take 60ms to startup in linux but 180ms in macos m1 pro.
below is the part of --startuptime output , the difference lines:
this is mac:

103.941  087.375  087.375: sourcing ~/.config/nvim/init.lua
183.011  044.137: VimEnter autocommands

this is linux:

030.694  026.166  026.166: sourcing ~/.config/nvim/init.lua
059.600  010.673: VimEnter autocommands

I don’t know why, mac hardware is much better than linux, and no harddisk encrypt.

`require` doesn't respect the order of paths in `runtimepath` option

require obtains module by searching path in a way that doesn't respect the order of paths in runtimepath option.

This behavior is caused by get_runtime_file function which may cache some path that would take precedence over other paths in rtp.

local function get_runtime_file(basename, paths)
-- Look in the cache to see if we have already loaded a parent module.
-- If we have then try looking in the parents directory first.
local parents = vim.split(basename, '/')
for i = #parents, 1, -1 do
local parent = table.concat(vim.list_slice(parents, 1, i), '/')
local ppath = M.modpaths:get(parent)
if ppath then
if ppath:sub(-9) == '/init.lua' then
ppath = ppath:sub(1, -10) -- a/b/init.lua -> a/b
else
ppath = ppath:sub(1, -5) -- a/b.lua -> a/b
end
for _, path in ipairs(paths) do
-- path should be of form 'a/b/c.lua' or 'a/b/c/init.lua'
local modpath = ppath..'/'..path:sub(#('lua/'..parent)+2)
if fs_stat(modpath) then
return modpath, 'cache(p)'
end
end
end
end
-- What Neovim does by default; slowest
local modpath = get_runtime(paths, false, {is_lua=true})[1]
return modpath, 'standard'
end

Test case

Saying the rtp is like following:

/home/xavier/.config/nvim
/etc/xdg/nvim
/home/xavier/.local/share/nvim/site
...

If I have these files in my rtp:

file 1. "/home/xavier/.config/nvim/lua/foo/bar.lua",
file 2. "/home/xavier/.local/share/nvim/site/lua/foo/init.lua",
file 3. "/home/xavier/.local/share/nvim/site/lua/foo/bar.lua",

First require('foo') and then require('foo.bar'), the intended behavior is that file 2 and file 1 will be loaded. file 3 will not be used because it has lower priority than file 1 in rtp.

But impatient breaks this mechanism here, as file 2 is cached first and would take precedence over other paths in rtp.

Hashing fails when neovim is installed as an AppImage.

Calls to vim.loop.fs_stat will fail for builtin lua files of neovim (such as /tmp/.mount_nvimYb1LQX/usr/share/nvim/runtime/lua/vim/treesitter/query.lua) in the impatient.lua hash function when neovim is installed as an AppImage. I imagine the main cause is that AppImage makes a new .mount_* directory on each launch (?).

Because the call fails it returns nil which doesn't have the mtime key/attribute resulting in error on the fs_stat line.

Could check that the file exists and as at least temporary fix skip these builtin lua files if they have the .mount_ directory as a parent in their filetree? E.g.

    local function load_package_with_cache(name)
        local basename = name:gsub('%.', '/')
        local paths = {
            "lua/" .. basename .. ".lua", "lua/" .. basename .. "/init.lua"
        }
        for _, path in ipairs(paths) do
            local found = vim.api.nvim_get_runtime_file(path, false)
            if #found > 0 then
                local modpath = found[1]
                local f, err = loadfile(modpath)
                -- Check if AppImage rtp file
                if not string.find(modpath, ".mount_") then
                    M.cache[name] = {modpath, hash(modpath), string.dump(f)}
                    log('Creating cache for module', name)
                    M.dirty = true
                end

                return f or error(err)
            end
        end
        return nil
    end

attempt to call field 'encode' (a nil value)

Nvim version: NVIM v0.6.0-dev+525-ge921e98ce

Error detected while processing VimEnter Autocommands for "*":
E5108: Error executing lua .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:243: attempt to call field 'encode' (a nil value)

minimal config:

require('packer').startup({function()
    use 'wbthomason/packer.nvim'
    use 'lewis6991/impatient.nvim'
end,
    config = {
        compile_path = vim.fn.stdpath('config')..'/lua/packer_compiled.lua',
    }
})

require('impatient')
require('packer_compiled')

LuaCacheProfile command errors if config is reloaded

Hi,

When reloading my config file I've noticed that having

require('impatient').enable_profile()

in my init.lua causes an error if I reload this file because the LuaCacheProfile command is missing a bang allowing it be redefined.

Error executing lua .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:44: Vim(command):E174: Command already exists: add ! to replace it: LuaCacheProfile lua _G.__luacache.print_profile()

mkdnflow.nvim not loaded correctly with impatient.nvim

I have filed a bug report with mkdnflow.nvim issue 49 since the plugin is not working correctly. @jakewvincent was able to track the error down to impatient.nvim

packer.nvim: Error running config for mkdnflow.nvim: ...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:216: attempt to index a nil value

Commenting out impatient.nvim solves the problem.

I am runngin Nvim 0.7 on Linux Mint 20/Ubuntu using Zsh-shell. My config is based on AstroNvim and you can find my personal config on nvim-config-astroVim/tree/mkdnflow_test

error when opening neovim [after the encode/decode commit]

i got this error:

Error detected while processing VimEnter Autocommands for "*":
E5108: Error executing lua .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:
243: attempt to call field 'encode' (a nil value)

my config hasnt been touched for 1 month.
the plugins i use were updated today ( i didnt look if impatient got any updates )
so my config is fine.

EDIT
my config:

  • packer config
    use {
        "lewis6991/impatient.nvim"
        -- 	config = {
        -- 		-- Move to lua dir so impatient.nvim can cache it
        -- 		compile_path = vim.fn.stdpath('config')..'init.lua.d/lua/packer_compiled.lua'
        -- 	}
    }
  • init.lua
require('impatient')

before loading all my plugins and config i load impatient

i had this config for a long time, long time no problem, but now, i get this stupid error

cmp-tabnine gets automatically loaded before cmp itself

See my issue here. tzachar/cmp-tabnine#32

tzachar/cmp-tabnine can't be installed when impatient.vim is enabled. No matter how often you clear or rebuild cache. It requires cmp_tabnine.config to be loaded. Impatient loads tabnine earlier than cmp for a reason I could not find.

If you have an auto reload of Packer upon save of your config file, Packer won 't reload properly before installation. I have resolved the installation issue with my pull request to tabnine above.

But there needs to be a rule set for this in impatient. I couldn't figure out how, and documentation didn't help me either. Maybe it's me, but it will definitely be someone else as well.

Any way to programmatically call this plugin in an sync way?

I'm currently working on containerizing my main development workflow and I would really love to run the caching from this plugin from the Dockerfile (so that when someone first starts the container instance all the lua modules are already fully cached). Any way to do that currently?

Error on startup: bad argument to 'loadlib' (string expected, got table)

After updating impatient.nvim to the most recent commit, I get this error on
startup:

E5108: Error executing lua
.../site/pack/packer/start/impatient.nvim/lua/impatient.lua:167: bad argument #1
to 'loadlib' (string expected, got table)

If I use the commit just before the most recent one
(282b99b), I don't get this, so I'm guessing
8ba91e2 caused the break.

NVIM version:

NVIM v0.7.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-8Xgljg/neovim-0.6.0~ubuntu1+git202112241248-0d7a97224-adeb5640f=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-8Xgljg/neovim-0.6.0~ubuntu1+git202112241248-0d7a97224-adeb5640f/build/config -I/build/neovim-8Xgljg/neovim-0.6.0~ubuntu1+git202112241248-0d7a97224-adeb5640f/src -I/build/neovim-8Xgljg/neovim-0.6.0~ubuntu1+git202112241248-0d7a97224-adeb5640f/.deps/usr/include -I/usr/include -I/build/neovim-8Xgljg/neovim-0.6.0~ubuntu1+git202112241248-0d7a97224-adeb5640f/build/src/nvim/auto -I/build/neovim-8Xgljg/neovim-0.6.0~ubuntu1+git202112241248-0d7a97224-adeb5640f/build/include
Compiled by buildd@lcy02-amd64-012

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Is it possible to use it with vim-plug?

Hello!

First of all, thanks for your outstanding work. I've been using multiple of your projects for some time already and they're amazing!

So, back to the topic. I have a trouble with some slow plugins which make my startup time around 700ms (me being on 11 years old HDD doesn't help XD). It's not a big deal, but it'd be nice to reduce it mb to 300. So I decided to try out this plugin.

Thing is, if I invoke setup it right after the end of vim-plug:

vim.call('plug#end')
require('impatient')

it won't affect my startup time.
But if I do it before, it will fail to find this module.

Any way I can fix that?

(and btw, I don't have a huge preference for vim-plug, so I probably don't mind moving to something newer, it just will take some time to migrate for my 40-50 plugins setup to ensure no errors and all, you know. so if impatient isn't working on vim-plug, I'll perhaps migrate)

Attempt to index nil error when original source doesn't exist

Issue:

The stat call here can return nil when the modpath doesn't exist

return vim.loop.fs_stat(modpath).mtime.sec

This should be handled .

Cause:

Since hash is called at startup on cached filepaths you can't guarantee that location is still valid.

if fhash ~= hash(f) then

Trigger:

Already cached plugin being uninstalled.

Possible solution:

diff --git a/lua/impatient.lua b/lua/impatient.lua
index 367411f..2eef442 100644
--- a/lua/impatient.lua
+++ b/lua/impatient.lua
@@ -65,7 +65,9 @@ do
   end
 
   local function hash(modpath)
-    return vim.loop.fs_stat(modpath).mtime.sec
+    local stat = vim.loop.fs_stat(modpath)
+    if not stat then return nil end
+    return stat.mtime.sec
   end
 
   local function load_package_with_cache(name)

Loading impatient with packer

Hi, I'm new to lua, started using Packer to install packages.
I saw an option to run a command with the installation, and I wonder why it's not documented here.

  use {
    'lewis6991/impatient.nvim',
    config = function() require('impatient').setup() end
  }

Wouldn't it work?
Thanks.

startup time slows down gradually after last `:LuaCacheClear`

when I clear the cache out, and relaunch neovim, startup time for me is ~3ms, but after editing some of my config files (which are cached), and reopening vim, the startup time increases (north of ~5ms)

it causes noticeable performance deficit the longer its been since the last LuaCacheClear. I have looked at the profile, and none of the files im editing (and cache invalidating) take long to load (using LuaCacheProfile), but the load time for plugins such as 'gitsigns' increases from sub 1 ms (in first few launches on clean cache), to north 2ms (after 10 mins of using vim normally, opening and closing config files, updating plugins, etc).

Please advise how to investigate this.

Enable profiling errors when used with fzy-lua-native

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.

attempt to perform arithmetic on field 'exec' (a nil value)

When I use

require('impatient').enable_profile()

I get an error

packer.nvim: Error running config for nvim-lspconfig: ...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:148: attempt to perform arithmetic on field 'exec' (a nil value)

I don't have this proble with

require('impatient')

Error loading so file '=' expected

packer.nvim: Error running config for xbase: .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:254: .../share/nvim/site/pack/packer/start/xbase/lua/libxbase.so:1: '=' expected

No sure why this is started happening tired previous commits but still I'd face the same error msg,

any ideas?

NVIM v0.8.0-dev                                                                                                          
Build type: Release                                                                                                      
LuaJIT)2.1.0-beta3                                                                                                       
Compiled by _nixbld4                                                                                                     
                                                                                                                         
Features: +acl +iconv +tui                                                                                               
See ":help feature-compile"                                                                                              
                                                                                                                         
   system vimrc file: "$VIM/sysinit.vim"                                                                                 
  fall-back for $VIM: "                                                                                                  
/nix/store/4865ii104xiwb9ycz4fh6h3z3bjvcdvl-neovim-unwrapped-master/share/nvim                                           
"                                                                                                                        
                                                                                                                         

plugins not load

The plugin is blocking the loading of others

-- lua/packages.lua
  use {
    'lewis6991/impatient.nvim',
    rocks = 'mpack'
  }
-- init.lua
require('impatient')
require('globals')
require('autocommands')
require('utils').init()
require('packages')
NVIM v0.6.0-dev+43-g02bf251bb
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Failed to load so after git pull

This commit works fine for me (2337df7).
But after I checkout to this commit (af0575e) , it cannot handle so.
Error as shown:
Screenshot_20220521_201354
This is error info after I checkout to 3680f3a
image
Log:
Loaded cache for path /home/huang/.local/share/nvim/site/pack/packer/opt/cmp-flypy.nvim/after/plugin/flypy.lua
Loaded cache for path /home/huang/.local/share/nvim/site/pack/packer/opt/cmp-flypy.nvim/lua/flypy.lua
No cache for path /home/huang/.local/share/nvim/site/pack/packer/opt/cmp-flypy.nvim/lua/libflypy.so

Allow overriding of cache file paths

I'm using nix package manager and I want to use separate cache for different neovim instances. The problem right now is I manage plugins with nix. All plugin paths are immutable. So impatient.nvim isn't working correctly. Because it implements a module resolution cache. In my case after upgrading all new plugins will be in a new directory. But the previous directory isn't removed immediately. It's immutable and it stays until I clean previous generations of a nix profile. So impatient.nvim checks that there is module in cache, checks that file is valid and it's still the same. My idea is that I will use a separate cache for every immutable plugin pack (for example I'll add a hash to cache file path). This way after upgrading there will be a new cache. But I'll still be able to use already running instance of neovim form previous generation with an old cache. I already tested it by temporary changing vim.env.XDG_CACHE_HOME before requiring impatient but I'd like a more simple approach. Also it's not required, but maybe create a directory if it doesn't exist?

Mac OSX Issues

I've encountered a lot of issues with my Neovim v0.6 config on my Mac. However, it seemed like disabling this plugin resolved all of my issues for some reason - not sure why though. Would love to still use this plugin as it significantly reduces my start up time (especially on Mac).

Format on save autocmd (in lsp/options.lua) due to vim.lsp.buf.formatting_sync():

image

nvim start:

image

Saving another opened buffer:

image

impatient.nvim and vim-plug

I haven’t seen this mentioned here. I used vim-plug as package manager before making the switch to packer. The impatient readme only mentions instructions for packer, but I tried impatient out on both managers to compare the results, otherwise same plugins and settings. Startup times tested with vim-startuptime (command line program). Mentioned times are averages after 10 loads.

  • vim-plug: In init.lua I loaded options, then required my plugin setup file and in this file required impatient directly after plug#end
    without impatient: 126ms
    with impatient: 84ms
  • packer: Startup with compiled packer file and required impatient at top of init.lua. No lazy loaded plugins.
    without impatient: 121ms
    with impatient: 82ms

I’d argue it’s perfectly viable to run impatient in combination with vim-plug on a modern neovim setup with lua config. I probably won’t go back to vim-plug, but it could be mentioned in the readme. The savings are comparable.

`DistantInstall` fails

Hi, found this weird bug a while ago, but for some reason, distant.nvim's DistantInstall command fails if I enable profiling with impatient.enable_profile(), but works completely fine with profiling disabled (default).

I get the following error message:

...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:231: attempt to index a nil value...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:231: attempt to index a nil value...c
k/packer/start/impatient.nvim/lua/impatient/profile.lua:231: attempt to index a nil value...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:231: attempt to index a nil value...ck/pa
cker/start/impatient.nvim/lua/impatient/profile.lua:231: attempt to index a nil value

cannot find mpack

I have install mpack using luarocks. I did it the packer way. I did the manually using luarocks --local install mpack and also the with sudo. But it doesn't work ?

impatient.lua:243: attempt to call field 'encode' (a nil value)

with the new update of this plugin,i get this error when I open neovim

Error detected while processing VimEnter Autocommands for "*":
E5108: Error executing lua .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:243: attempt to call field 'encode' (a
 nil value)

when I open neovim, I get this error
I'm in Linux: Void-linux
nvim version: NVIM v0.6.0-dev+a5d6f36
this error come from this function

function M.save_cache()
  if M.dirty then
    log('Updating cache file: %s', M.path)
    local f = io.open(M.path, 'w+b')
    f:write(mpack.encode(M.cache))
    f:flush()
    M.dirty = false
  end
end

when go back to to commit 561b86e I see that I should be

-      f:write(mpack.encode(M.cache))
+      f:write(mpack.pack(M.cache))

-      return mpack.unpack(f:read'*a')
+      return mpack.decode(f:read'*a')

No difference in startuptime when profiling with dstein64/vim-startuptime

Now, let me prefix this by saying, that I might have misunderstood the aim of this project, or misconfigured something. What I'm seeing is the following:

When I take a look at LuaCacheProfile after consecutive startups after LuaCacheClear, This is the first startup after clearing:

    Resolve                  Load
   12.850ms │           │   36.882ms │           │ Total                                         │
...

and this is after the cache has been built (after second startup):

    Resolve                  Load
    3.816ms │           │    4.391ms │           │ Total                                         │ 
...

So there definitely seems to be a difference between cached and uncached startup. However, I didn't notice any difference in the startuptime, so I installed dstein64/vim-startuptime and took a look at StartupTime in between cached and uncached startups. The result: I'm averaging around 160mS and it doesn't seem to matter if I have a built cache or not.

I've installed impatient via packer. I set up impatient before any other code is run.

Looking at #31, I might lack some information on how to actually set this up or how the plugin works together with packer. Can you help me out here? Or is this simply not how it works?

Using `mtime.secs` for hash is incompatible with Nix managed configurations

I've migrated to using Nix to manage my dotfiles and system configuration which which sets all file timestamps to 0. After migrating my fledgling neovim configuration over, I noticed that none of my changes were taking after updating my configs unless I deleted ~/.cache/nvim/luacache. This was not an issue before I migrated my configuration over to nix. After digging into the source, I see the hash function is as follows:

local function hash(modpath)
  local stat = fs_stat(modpath)
  if stat then
    return stat.mtime.sec
  end
end

For this to be more robust an actual file hash would need to be performed, though I imagine that would also slow things down. However, if the goal is for this plugin to eventually be merged into neovim core I think this would impact every Nix neovim user if it were merged with the hash function as-is.

make command exits with error

Hi there,
I just tried to add this project to my configuration. For this I did the following steps:

  • Add Plug 'lewis6991/impatient.nvim' to init.vim
  • Entered the directory where it has been cloned in and executed make

This failed and produced the output as below. What am I missing?

Thanks in advance!

git clone --depth 1 https://github.com/neovim/neovim --branch master neovim-master
make -C neovim-master
make[1]: Entering directory '/home/user/.config/nvim/plugged/impatient.nvim/neovim-master'
mkdir -p ".deps"
cd .deps && \
	cmake -G 'Ninja'   \
	 /home/user/.config/nvim/plugged/impatient.nvim/neovim-master//third-party
-- The C compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test HAS_OG_FLAG
-- Performing Test HAS_OG_FLAG - Success
-- Found GNU Make at /usr/bin/gmake
-- The CXX compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Performing Test HAS_NO_STACK_CHECK
-- Performing Test HAS_NO_STACK_CHECK - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps
mkdir -p build
touch build/.ran-third-party-cmake
ninja  -C .deps
ninja: Entering directory `.deps'
[1/106] Creating directories for 'libuv'
[2/106] Creating directories for 'msgpack'
[3/106] Creating directories for 'luajit'
[4/106] Creating directories for 'treesitter-c'
[5/106] Creating directories for 'libvterm'
[6/106] Creating directories for 'lua-compat-5.3'
[7/106] Creating directories for 'tree-sitter'
[8/106] Creating directories for 'unibilium'
[9/106] Creating directories for 'gperf'
[10/106] Performing download step for 'libvterm'
-- file: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/libvterm/libvterm-0.1.4.tar.gz
-- downloading...
       src='https://www.leonerd.org.uk/code/libvterm/libvterm-0.1.4.tar.gz'
       dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/libvterm/libvterm-0.1.4.tar.gz'
       timeout='none'
-- downloading... done
-- extracting...
     src='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/libvterm/libvterm-0.1.4.tar.gz'
     dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/libvterm'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean binary dir]
-- extracting... [clean up]
-- extracting... done
[11/106] No update step for 'libvterm'
[12/106] No patch step for 'libvterm'
[13/106] No configure step for 'libvterm'
[14/106] No build step for 'libvterm'
[15/106] Performing install step for 'libvterm'
FAILED: build/src/libvterm-stamp/libvterm-install /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/libvterm-stamp/libvterm-install 
cd /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/libvterm && /usr/bin/gmake CC=/usr/bin/cc PREFIX=/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/usr CFLAGS=-fPIC LDFLAGS+=-static CFLAGS+=-Og CFLAGS+=-g install && /usr/bin/cmake -E touch /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/libvterm-stamp/libvterm-install
gmake[2]: Entering directory '/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/libvterm'
install -d /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/usr/include
install -m644 include/vterm.h include/vterm_keycodes.h /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/usr/include
install -d /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/usr/lib/pkgconfig
sed -e "s,@PREFIX@,/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/usr," -e "s,@LIBDIR@,/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/usr/lib," -e "s,@VERSION@,0.1.4," <vterm.pc.in >/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/usr/lib/pkgconfig/vterm.pc
CC src/encoding.c
gmake[2]: libtool: No such file or directory
gmake[2]: *** [Makefile:60: src/encoding.lo] Error 127
gmake[2]: Leaving directory '/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/libvterm'
[16/106] Performing download step for 'lua-compat-5.3'
-- file: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/lua-compat-5.3/v0.9.tar.gz
-- downloading...
       src='https://github.com/keplerproject/lua-compat-5.3/archive/v0.9.tar.gz'
       dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/lua-compat-5.3/v0.9.tar.gz'
       timeout='none'
-- downloading... done
-- extracting...
     src='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/lua-compat-5.3/v0.9.tar.gz'
     dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/lua-compat-5.3'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean binary dir]
-- extracting... [clean up]
-- extracting... done
[17/106] Performing download step for 'gperf'
-- file: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/gperf/gperf-3.1.tar.gz
-- downloading...
       src='https://github.com/neovim/deps/raw/ff5b4b18a87397a8564016071ae64f64bcd8c635/opt/gperf-3.1.tar.gz'
       dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/gperf/gperf-3.1.tar.gz'
       timeout='none'
-- downloading... done
-- extracting...
     src='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/gperf/gperf-3.1.tar.gz'
     dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/gperf'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean binary dir]
-- extracting... [clean up]
-- extracting... done
[18/106] Performing download step for 'unibilium'
-- file: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/unibilium/92d929f.tar.gz
-- downloading...
       src='https://github.com/neovim/unibilium/archive/92d929f.tar.gz'
       dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/unibilium/92d929f.tar.gz'
       timeout='none'
-- downloading... done
-- extracting...
     src='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/unibilium/92d929f.tar.gz'
     dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/unibilium'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean binary dir]
-- extracting... [clean up]
-- extracting... done
[19/106] Performing download step for 'luajit'
-- file: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/luajit/1d20f33d2905db55fb7191076bbac10f570f9175.tar.gz
-- downloading...
       src='https://github.com/LuaJIT/LuaJIT/archive/1d20f33d2905db55fb7191076bbac10f570f9175.tar.gz'
       dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/luajit/1d20f33d2905db55fb7191076bbac10f570f9175.tar.gz'
       timeout='none'
-- downloading... done
-- extracting...
     src='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/luajit/1d20f33d2905db55fb7191076bbac10f570f9175.tar.gz'
     dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/luajit'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean binary dir]
-- extracting... [clean up]
-- extracting... done
[20/106] Performing download step for 'treesitter-c'
-- file: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/treesitter-c/v0.20.1.tar.gz
-- downloading...
       src='https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.1.tar.gz'
       dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/treesitter-c/v0.20.1.tar.gz'
       timeout='none'
-- downloading... done
-- extracting...
     src='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/treesitter-c/v0.20.1.tar.gz'
     dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/treesitter-c'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean binary dir]
-- extracting... [clean up]
-- extracting... done
[21/106] Performing download step for 'msgpack'
-- file: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/msgpack/msgpack-3.0.0.tar.gz
-- downloading...
       src='https://github.com/msgpack/msgpack-c/releases/download/cpp-3.0.0/msgpack-3.0.0.tar.gz'
       dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/msgpack/msgpack-3.0.0.tar.gz'
       timeout='none'
-- downloading... done
-- extracting...
     src='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/msgpack/msgpack-3.0.0.tar.gz'
     dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/msgpack'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean binary dir]
-- extracting... [clean up]
-- extracting... done
[22/106] Performing download step for 'libuv'
-- file: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/libuv/v1.44.0.tar.gz
-- downloading...
       src='https://github.com/libuv/libuv/archive/v1.44.0.tar.gz'
       dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/libuv/v1.44.0.tar.gz'
       timeout='none'
-- downloading... done
-- extracting...
     src='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/libuv/v1.44.0.tar.gz'
     dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/libuv'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean binary dir]
-- extracting... [clean up]
-- extracting... done
[23/106] Performing download step for 'tree-sitter'
-- file: /home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/tree-sitter/v0.20.6.tar.gz
-- downloading...
       src='https://github.com/tree-sitter/tree-sitter/archive/v0.20.6.tar.gz'
       dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/tree-sitter/v0.20.6.tar.gz'
       timeout='none'
-- downloading... done
-- extracting...
     src='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/downloads/tree-sitter/v0.20.6.tar.gz'
     dst='/home/user/.config/nvim/plugged/impatient.nvim/neovim-master/.deps/build/src/tree-sitter'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean binary dir]
-- extracting... [clean up]
-- extracting... done
ninja: build stopped: subcommand failed.
make[1]: Leaving directory '/home/user/.config/nvim/plugged/impatient.nvim/neovim-master'
make[1]: *** [Makefile:107: deps] Error 1
make: *** [Makefile:14: neovim-master] Error 2

trailing data in msgpack string

Installed this plugin with packer with mpack luarock and added require('impatient') to the top of my init.lua file, getting following error on each nvim start now:

Error detected while processing /Users/<me>/<…>/nvim/init.lua:
E5113: Error while calling lua chunk: .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:121: trailing data in
 msgpack string
Press ENTER or type command to continue

How could I debug it?

Does impatient cache opt as well?

Hey @lewis6991 thanks a lot for taking the time to put this together.

I wonder if opt lua files are cached as well, because I feel this might be the cause of impatient taking longer time to load. before it was like 3.1ms

impatient                                      │     mixed │   0.4379ms │   5.7322ms │   6.1700ms │

Attempt to call a nil value when require from init.vim

Hello,

for of all - thank you for this plugin. I love to improve speed of my neovim. Currently I have load time of 500ms with 72 plugins and want to improve it.

In my neovim I use both init.vim and init.lua because I am still refactoring it. So after installing it via packer in first line:

...
local use = packer.use

-- Packer can manage itself
use 'wbthomason/packer.nvim'

-- Needed to load first
use {'lewis6991/impatient.nvim', rocks = 'mpack'}
...

it correctly installed impatient.nvim and mpack. First I wanted to require it via packer by adding config = "require('impatient')" but it didn't work.

Now in my init.vim I added first line as

lua require('impatient')

but it throws such an errors and doesn't work:

Error detected while processing BufEnter Autocommands for "*":                                                                                                                                                                                                                                                                                  
E5108: Error executing lua .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:113: attempt to call a nil value     
... (then after going to any file from startify):                                                                                                                                                                                                                    
E5108: Error executing lua [string ":lua"]:1: loop or previous error loading module 'nvim-tree' 

Then also telescope.nvim and nvim-tree doesn't work at all.

I'm using the newest version of Neovim v0.6.0-dev+200-gb35de6c52.
Any suggestions on how can I fix it?

Problem with " " (space) in file path

E5113: Error while calling lua chunk: .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:123: Vim(set):E518: Unknown option: Support/nvim/site/pack/pac
ker/start/coq_nvim,/Library/Application
Error detected while processing /Library/Preferences/nvim/plugin/vendor/lsp.lua:
E5113: Error while calling lua chunk: .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:123: Vim(set):E518: Unknown option: Support/nvim/site/pack/pac
ker/start/coq_nvim,/Library/Application

Looks like it divided "Application" and "Support".

missing file `mpack`

:lua require('impatient')

E5108: Error executing lua .../site/pack/packer/start/impatient.nvim/lua/impatient.lua:85: module 'mpack' not found:           
        no field package.preload['mpack']                                                                                      
        no file './mpack.lua'

amazing!!! But is require('packer_compiled') neccessary?

I have config like this

require('impatient')
-- require('packer_compiled')
  use {'lewis6991/impatient.nvim',config = {
    compile_path = '~/.config/nvim/lua/plugin/packer_compiled.lua'
  }

and the startup speed is nearly 2X faster than before.
but require('packer_compiled') report an error:

module 'packer_compiled' not found

so i comment it.

E5560: nvim_get_option must not be called in a lua loop callback

I've hit this after the latest updates, while using nvim-dap (never happened before):

Error executing luv callback:
.../site/pack/packer/start/impatient.nvim/lua/impatient.lua:138: E5560: nvim_get_option must not be called in a lua loop callback

nvim 0.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.