≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Feature request #1833

Feature request #1833: Cache file listing to disk

Kind feature request
Product Command-T
When Created 6/10/2011, updated 2/24/2012
Status open
Reporter Greg Hurrell
Tags no tags

Description

From a user email:

I have a project with about 50,000 files in it. Is there a way to:

  1. cache the cache to the files system. So I can open vim and bypass the 30 seconds to read all of the files for my project.

#Is there away to have CommandT parse files from a predefined directory instead of at :PWD?

Comments

  1. Greg Hurrell 6/10/2011

    I've pasted this in here to track the feature request for caching.

    As to your second question, you can pass in a directory: eg. :CommandT some/directory

  2. lukasz Created 6/28/2011, edited 6/29/2011

    My project is over 15 000 files.

    Problems:

    1. First run is about 10 sec.
    2. After typing first 3 characters - waiting for search about 5 sec. Every time. Next characters go faster of course. But imagine you make mistake and have to backspace this first chars.
    3. Not all diretories (on the first level) are scaned (or at least searchable).

    my setting: let g:CommandTMaxFiles=100000

    For example if i run vim in root directory of my project, and run

    :CommandT

    it doesn't see any file in IDX directory.

    If i run

    :CommandT IDX

    every thing is OK.

    -- lukasz

  3. Greg Hurrell 6/29/2011

    There is no quick and easy fix for the performance degradation, I'm afraid. The first run is slow because it has to traverse the entire directory hierarchy, in Ruby. The initial slowness as it narrows down the list may just be because the number of files you're dealing with is too much for your machine (ie. perhaps enough to push some of the working set out of the processor cache).

    As for the third issue, perhaps your Vim 'wildignore' setting is responsible for excluding that directory. Or perhaps you have more files than you think? I'm pretty confident there are no bugs which would cause Command-T to overlook an entire directory hierarchy.

  4. lukasz 6/29/2011
    $ ls -R . | wc -l
    13611
    
    : set wildignore
    wildignore=
    

    We must do it something with performance - cannot work without this plugin ;).

    For now I use:

    :CommandT dir

    Maybe it will be a temporary solution to create new leader shortcut eg.: \y direcotry search_string

    In that case it will first switch to "direcotry" like :CommandT dir (just after pressing space after the first word), and then perform normal search with "search_string".

  5. Greg Hurrell 10/30/2011

    See also feature request #1878. That one adds the ability to use multiple caches, keyed off of directory names, so you could use :CommandT dir to limit the scope to a particular directory, but still get the benefit of the cache.

  6. Greg Hurrell 10/30/2011

    Closed this topic ("Slow startup in large project") as a duplicate of this ticket.

  7. JKkim 1/6/2012

    Hello I just moved command-t from fuzzy-finder and I really satisfied with this plugin. however nowadays I am working in Android. Android project has over 100,000 files. therefore I need the feature that original poster asked. It would be nice, great if command-t can reopen the cache when I re-run the vim. For this functionality, cache could be file by options and could be select from cache-list window, when I want to re-open the cache. I grant that Command-T is still great and would be more great if it gives above functions. please........... In fact, I re-compiled the VIM only for using command-t in Cygwin. plz from JK. seoul korea

  8. dtb 2/14/2012

    Hey folks, I'm working on a patch to cache the directory listing to disk on first run, so that you can avoid the startup delay. Subsequent runs would use the cache.

    I've got a first pass of this over on a branch of my fork of Command-T. I'm going to try it out a bit, and once everything is looking good, I'll send a pull request.

  9. anonymous 2/22/2012

    I am working on a mounted ssh file system and it's very slow every time to generate the cache. I will try your implementation JKkim

  10. dtb 2/24/2012

    I added a pull request for this feature.

    If anyone wants to try it out, just go to my fork, then follow the instructions to install the plugin. After you do that, go into the install directory, and do a

      git checkout cache-paths-to-disk

    Then, be sure to edit your vimrc to enable the cache:

     let g:CommandTCacheIndexToDisk=1
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets