telescope-project.nvim icon indicating copy to clipboard operation
telescope-project.nvim copied to clipboard

Slow startup

Open rgnkn opened this issue 2 years ago • 2 comments

First of all, thank you for this fantastic plugin.

I just want to mention that I found out that telescope-project.nvim dramatically slows down my startup time. I use packer for plugin configuration and my local figures are as follows:

vim --startuptime with telescope-project.nvim: ~ 255ms vim --startuptime without telescope-project.nvim (simply commented out): ~ 95ms

Is there any way to reduce startup time? Is this a bug? Does anyone else see this behaviour?

This is somewhat okay for me, but as I guess that this relates to reading of the project cache file, could this be enhanced (maybe async if not already)?

Thanks in advance for your feedback.

[EDIT] Some details on my system:

  • Figures are from Ubuntu 21.10 but similar figures on Manjaro
  • vim => NVIM v0.7.0-dev
  • 76 plugins (of which 1 is optional)
  • 3 directories as local base_dirs (all in ~):
    • 2 * max_depth = 4
    • 1 * max_depth = 5

rgnkn avatar Feb 25 '22 15:02 rgnkn

@rgnkn, you can add keys and after prop in packer to lazy load this.

lalitmee avatar Mar 24 '22 06:03 lalitmee

For me lazyloading with after or keys doesn't work since you have to load the extension in telescope config:

require'telescope'.load_extension('project')

If only I could open projects using something like :Telescope projects since my packer is configured thusly:

{
	"nvim-telescope/telescope.nvim",
	config = [[require("plugins.setup.telescope")]],
	requires = {
		{
			"nvim-telescope/telescope-fzf-native.nvim",
			run = "make",
		},
		{ "nvim-telescope/telescope-project.nvim" },
		{ "nvim-telescope/telescope-ui-select.nvim" },
	},
	cmd = "Telescope",
},

catgoose avatar May 23 '22 11:05 catgoose

hihi, i don't use packer,

but this is what i did

:lua require'telescope'.extensions.project.project{}

instead of

:Telescope project

ANGkeith avatar Dec 16 '22 17:12 ANGkeith

Working lazy cfg:


  "nvim-telescope/telescope-project.nvim",
  dependencies = { "nvim-telescope/telescope.nvim", "nvim-telescope/telescope-file-browser.nvim" },
  event = "VeryLazy",
  keys = {
    {
      "<leader>fp",
      function() require("telescope").extensions.project.project {} end,
      desc = "Projects",
    },
  },
}

Don't forget to load_extension

teocns avatar Dec 28 '23 08:12 teocns