chadtree icon indicating copy to clipboard operation
chadtree copied to clipboard

chadopen is a bit slow on first run

Open smartding opened this issue 4 years ago • 20 comments

The first time I run chadopen, there's delay about half a second. No delay on subsequent chadopen. I've disabled session and version control;

  vim.api.nvim_set_var("chadtree_settings", {
    session = false,
    version_control = {
      defer = true,
      enable = false
    },
  })

Is there any other tricks I can use to speed up chadopen?

smartding avatar Nov 18 '20 12:11 smartding

I will do a refactor soon, to make sure CHADTREE runs in its own process apart from neovim's recommended way.

might speed it up.

right now all python extensions run in the same process which is a bit dumb imo

edit:

oops clicked close button by accident

ms-jpq avatar Dec 23 '20 03:12 ms-jpq

https://github.com/ms-jpq/chadtree/pull/100

will close

ms-jpq avatar Jan 05 '21 06:01 ms-jpq

I see a pretty big difference when I make it so that git is deferred too.

I will probably make it so that's the case by default

ms-jpq avatar Jan 15 '21 18:01 ms-jpq

hey @ms-jpq , so it should be fast now? for me its still a bit slow ( like a few seconds on small projects )

alex-popov-tech avatar Jan 22 '21 13:01 alex-popov-tech

Yes, a bit slow for me as well.

sheluchin avatar Jan 22 '21 18:01 sheluchin

a few seconds? that sounds weird,

are you guys on the newest thingy? it should have asked you to install some stuff if you do have the new version

ms-jpq avatar Jan 26 '21 00:01 ms-jpq

hey, yes, i've installed chadtree couple of days ago

alex-popov-tech avatar Jan 26 '21 08:01 alex-popov-tech

For me, it's around 1.5 to 2 seconds on the first run.

mpasa avatar Jan 26 '21 09:01 mpasa

same for me

alex-popov-tech avatar Jan 26 '21 09:01 alex-popov-tech

Yes, I also had a brand new install when I posted my above comment and it took about 2 seconds to run for me as well.

sheluchin avatar Jan 26 '21 23:01 sheluchin

Mine is around 2 - 3 seconds, plus the command J doesn't work at first. I need to toggle the tree off and on again to get the J works. Anw, great works, I believe this project will completely replace NERDTree some day.

finnng avatar Jan 27 '21 13:01 finnng

@finnng plus the command J doesn't work at first

thanks, good catch, i will fix that on my next PR.


to everybody who commented:

can I get more information on your local python setup? I will try to figure out why it is slower for you

ms-jpq avatar Jan 27 '21 15:01 ms-jpq

What kind of info do you need?

➜ python3 --version
Python 3.8.5

finnng avatar Jan 27 '21 15:01 finnng

humm, you know what I think I will implement a profiler first and then ask you to turn it on later.

Can I tag you in this later? Im gonna sleep first, havnt closed my eyes in forever.

Thanks ^_^

ms-jpq avatar Jan 27 '21 15:01 ms-jpq

Sure, I will help.

finnng avatar Jan 27 '21 15:01 finnng

Alright, so if you want to help out please do the following:

  1. Update CHADTree to latest version.
  2. Set let g:chadtree_settings = {'profiling': v:true}
  3. Do :CHADopen
  4. Do :messages

You should see something like this:

图片

please post the results.

Mine takes 550ms to open on my laptop

thanks !


If you are on Linux, it should be notably faster with the same hardware, due to superior IO performance.

If you are not MacOS, you might get much faster performance if you shutoff your internet...

https://news.ycombinator.com/item?id=25074959

Apple in their infinite wisdom decided to block all executable from launching unless they pass an online security check

If you are on Windows, and it's slow I can probably do very little to help because I don't actually have a windows machine, I just test on my parent's TV box to make sure it runs...


Please also provide your computer's hard drive info if you are willing. ie. if CHADTree is installed on SSD or HDD

ms-jpq avatar Jan 27 '21 19:01 ms-jpq

Init       38578ms                                                                                                                                            
First msg  1154ms                                                                                                                                             
Arch       x86_64                                                                                                                                             
Processor  x86_64                                                                                                                                             
Cores      4                                                                                                                                                  
System     Linux                                                                                                                                              
Version    #43-Ubuntu SMP Tue Jan 12 12:42:13 UTC 2021                                                                                                        
Python     /home/sheluchin/.pyenv/versions/3.8.3/bin/python3.8 

PC300 NVMe SK hynix 512GB (20005A00) SSD

sheluchin avatar Jan 27 '21 21:01 sheluchin

wtf 40 seconds to start?

and you have a NVMe SSD too!

ill investigate if pyenv is causing issues for people.

It takes like 0.5 seconds to start on my old desktop, under linux

图片

ms-jpq avatar Jan 28 '21 01:01 ms-jpq

Let me know if there's anything else I can do to help you track it down.

sheluchin avatar Jan 28 '21 01:01 sheluchin

Init       1595ms                                                                                                                                                             
First msg  149ms                                                                                                                                                              
Arch       x86_64                                                                                                                                                             
Processor  i386                                                                                                                                                               
Cores      16                                                                                                                                                                 
System     Darwin                                                                                                                                                             
Version    Darwin Kernel Version 20.2.0: Wed Dec  2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64                                                                   
Python     /Users/alexanderpopov/.asdf/installs/python/3.9.0/bin/python3.9                                                                                                    

macos ssd

alex-popov-tech avatar Jan 28 '21 07:01 alex-popov-tech